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

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

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); }