After all these years, it fell to an actor-turned president to give Canada credit where credit was due.

The Hollywood success of "little Gladys Smith" from Toronto is not an unusual story, Ronald Reagan told a joint session of Parliament here yesterday.

"Before long, little Gladys Smith was embraced by our entire nation. Gladys Smith of Toronto became Mary Pickford," Reagan said.

"And I know you'll forgive us for adopting her so thoroughly that she became known the world over as 'America's Sweetheart.'"

Canadians account for about one-fifth of the motion picture industry's population, according to Reagan. In fact, some of his best friends are Canadians like Art Linkletter, Glenn Ford, Raymond Massey, Walter Pidgeon and Raymond Burr.

He described them all as "close professional colleagues, if not close personal friends (who) ddid not come from America's heartland as I did but from the heart of Canada, as did most of you in this historic chamber."

Earlier in the day, laying to rest once and for all his campaign remark that trees pollute the air, he joined the tradition of other visiting leaders by planting a silver maple on the grounds of Government House, the residence of Canada's governor general, Edward R. Schreyer.

"Do I have to do this all myself?" he said spotting a mound of dirt beside the 6-year-old tree already more or less in place. Six scoops later, he accompanied First Lady Nancy Reagan to a similar maple nearby, where she shoveled seven scoops.

In the background were the maples planted during similar ceremonies in 1972 by Richard Nixon and his wife, Pat.

A quartet of black squirrels played on the lawn and a few snowflakes fell as the president joked that it was "the best exercise I've had for some time." He told Schreyer that "I'll be back when it needs pruning."

The Reagans also left their marks at the historic Library of Parliament where they signed distinguished-visitors books. When Nancy Reagan expressed some concern about the legibility of her signature, the president reassured her.

"Honey, don't worry about your writing," he said. "You can't be a diplomat if anybody can read your writing."

Watching the Reagans depart from Parliament Hill were protesters who had made up a larger and noisier demonstration upon the Reagans' arrival Tuesday.

Other attempts to demonstrate were unsuccessful. A smaller protest that threatened Nancy Reagan's Tuesday visit to the Clifford Bowey School for the Mentally Retarded never appeared. A member of the Ottawa School Board, which has jurisdiction over the boys' school, also tried to cancel her visit there. The first lady was never told about either of these attempts.

Sheila Patton, Mrs. Reagan's press secretary, said she never told the first lady about the possibility of an incident because "we knew the night before it had been resolved and there was so little likelihood of anything happening. Anybody familiar with the situation was convinced there wasn't the tiniest chance of anything happening."

She said she does not have any set policy on when to alert Nancy Reagan on such matters. "I use my own judgment on it," Patton said.

American and Canadian officials weren't taking any chances and had drawn up alternative arrangements in case Nancy Reagan's school drop-in had to be scrubbed.

"It was one man, one socialist," said a U.S. official, downplaying the school trusty's effort to cancel the first lady's visit. The board voted 12-to-1 against John Smart's demand that the school not be part of what was called "a public relations" exercise in view of President Reagan's cuts in funds for education in the United States.

He said there were some parents who considered keeping their children home because of their concern that a demonstration might disrupt the school day and upset their children.

"Fortunately, before anybody went to bed the night before, we knew it wasn't going to be a problem," he said.