Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: usage on get_simple_transform on goocanvas

by zentara (Archbishop)
on Oct 02, 2008 at 11:57 UTC ( [id://714987]=note: print w/replies, xml ) Need Help??


in reply to usage on get_simple_transform on goocanvas

First, there is no get_simple_transform in Goo. There is a set, but no get.

Second, if I chnage

my ($x, $y, $scale, $angle) = $group->get_simple_transform; #to my ($x, $y, $scale, $angle) = $group->get_transform;
I get a crash saying
*** glibc detected *** /usr/bin/perl: double free or corruption (out): + 0x08157b18 *** ======= Backtrace: ========= /lib/libc.so.6[0xb7dc0c23] etc etc

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://714987]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-19 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found