There's more than one way to do things | |
PerlMonks |
Re: usage on get_simple_transform on goocanvasby zentara (Archbishop) |
on Oct 02, 2008 at 11:57 UTC ( [id://714987]=note: print w/replies, xml ) | Need Help?? |
First, there is no get_simple_transform in Goo. There is a set, but no get. Second, if I chnage I get a crash saying
I have 2 thoughts. First, it may be a bug. The Goo::Canvas is still in development and possibly this is a glitch. Second, (and most likely), you can't call get_transform on a group, you may need a GroupModel. If you look at the manpages for Goo, you will see that Group descends from ItemSimple, which has very few methods available to it. However GroupModel descends from ItemModel, which has a wide assortment of methods available. The question was asked before, I think by you, "what is the difference between 'X' and 'X'Model? ". I think you are getting an answer to your question. Look at the difference between the demo.pl and the mv-demo.pl in the Goo demo subdir. The mv-demo.pl uses the Model approach, and the demo.pl uses the simple approach. You cannot just convert the script by appending Model to your Item names, you need to write the script differently. I tried to call $group->get_transform in the mv-demo.pl, and it did not crash the program, while calling it in your script does. The difference? mv-demo.pl uses the GroupModel, while you are using the simple Group. After studying the mv-demp.pl, it is not trivial to convert your program. If you don't want to alter it to the Model style, you may have to resort to manually saving transforms yourself. I'm not really a human, but I play one on earth Remember How Lucky You Are
In Section
Seekers of Perl Wisdom
|
|