Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Gnome2::Canvas - things on top of other things

by Anonymous Monk
on May 25, 2015 at 20:47 UTC ( [id://1127719]=note: print w/replies, xml ) Need Help??


in reply to Gnome2::Canvas - things on top of other things

I think you haven't checked the docs for ->raise, the real docs for ->raise

You want to raise to the top? use raise_to_top

You want to raise more than one step? Give raise a big number of steps

Replies are listed 'Best First'.
Re^2: Gnome2::Canvas - things on top of other things
by Anonymous Monk on May 28, 2015 at 09:17 UTC

    Yes, thank you. I had thought that ->raise() and ->lower() were using levels, rather than a stack.

    The solution here is to use ->raise_to_top() with the text. A general solution is to use ->lower_to_bottom and ->raise(n) with the text, where n is the number of squares.

    # Draw some blue text above the squares for (my $count = 0; $count < 5; $count++) { my $text = Gnome2::Canvas::Item->new( $canvasRoot, 'Gnome2::Canvas::Text', x => (($count * 100) + 25), y => (($count * 100) + 25), fill_color => '#0000FF', font => 'Sans', size => 10000, anchor => 'GTK_ANCHOR_W', text => 'Hello world!', ); $text->lower_to_bottom(); # Raise the text above the 5 squares in the Canvas stack $text->raise(5); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-28 18:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found