Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Goo Canvas clicking pass through transparency

by renegadex (Beadle)
on Jul 25, 2008 at 01:49 UTC ( [id://700013] : perlquestion . print w/replies, xml ) Need Help??

renegadex has asked for the wisdom of the Perl Monks concerning the following question:

in gnome2 canvas if you have a picture with transparent areas, you can click right thru and select items that are behind the transparent area. how do i achieve this in goo canvas? in gnome2 i just simply remove the event signals and i can click items behind the transparent areas...
  • Comment on Goo Canvas clicking pass through transparency

Replies are listed 'Best First'.
Re: Goo Canvas clicking pass through transparency
by Anonymous Monk on Jul 25, 2008 at 04:41 UTC
    catch the event signal and pass to the item underneath the transparent area
Re: Goo Canvas clicking pass through transparency
by zentara (Archbishop) on Jul 25, 2008 at 14:03 UTC
    Hey, if you figure it out, post an example please. :-) From my testing, rects and ellipses with transparent centers will let the signal pass thru, but a transparent section of an image shows the image as the current item. If you look at the Goo demo, and move the toroid.png ( with a transparent center) over another item, then try to drag the item in the visible hole, the toroid moves. In the Gnome2::Canvas, the item in the hole will be detected and moved. Maybe the beta state of Goo still has this as a limitation? Maybe you could work around it by adjoining separate images, so they have a whole in them.... kind of clunky. :-)

    I'm not really a human, but I play one on earth Remember How Lucky You Are
      i got an idea.. how about putting a layer with transparent fill above the image and the transparent image? the layer at the bottom has no signal handler, instead the the layer with transparent fill recieved the signal and when moved, it moves and let the image at the bottom be dragged along with it. its like sandwiching the "transparent image w/ hole" between the "image" and the "transparent filled rectangle" !! maybe i try to make an example later. :D