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

In reply to Re: usage on get_simple_transform on goocanvas by zentara
in thread usage on get_simple_transform on goocanvas by renegadex

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.