gtk.DrawingArea + Cairo

John (J5) Palmieri johnp at redhat.com
Thu Apr 19 18:05:56 EDT 2007


On Wed, 2007-04-18 at 14:49 -0700, Don Hopkins wrote:
> Is there a way for Hippo IconButton subclass to grab the mouse? 
> (I want the button to continue tracking until the mouse button goes
> up, no matter where the cursor moves on the screen.) 
> Do I need to drop down to GTK to do that? 
> If so, which GTK window do I need to grab, to cause grabbed events to
> be delivered to the Hippo canvas? 
> I tried the obvious one (self._window.window) but that doesn't seem to
> work... 
> Should Hippo have its own API for grabbing the mouse? 
> 
> Thanks! 
> 
>     -Don
> 

You get this information already.  When a HippoCanvasBox is clicked you
get a button-press-event and a mouse grab.  When it is released you get
button-release-event always.  You need to call set_clickable on the box
(IconButton should inherit from Box).  You have to understand that you
will always get a button-release-event even if the mouse is not over the
button when released.  set_clickable will call the activate signal for a
real click (mouse is over the button when released).  As far as I can
tell we are still sending activate signals on mouse down.  This is a bug
in sugar for working with older canvases and we should start relying on
mouse clicks.

-- 
John (J5) Palmieri <johnp at redhat.com>




More information about the Devel mailing list