[Glade-users] pointer_motion, button_press, etc. not working

Greg Hamilton gregh@object-craft.com.au
Wed, 28 Jan 2004 15:45:29 +1100


In reply to my own question, if the motion_notify_event handler calls 
event.window.get_pointer() to get the x,y position of the mouse and the 
buttons state then the events keep occurring. If, as I was doing, you 
just print a debug message and don't bother grabbing that information 
the event only happens once.

Odd.

On 28/01/2004, at 3:24 PM, Greg Hamilton wrote:

> Hi,
>
> I'm having what I gather is a fairly common Glade newbie problem. I 
> want to handle pointer motion and button press signals over a drawing 
> area. I'm using Glade 2.0.0, Python 2.2 and PyGTK 2.0
>
> I've created a simple test window in Glade - a drawing area in a vbox 
> in a window. I've added signal handlers to the drawing area for 
> 'button_press_event', 'motion_notify_event', 'configure_event' and 
> 'expose_event'. As expected configure and expose worked straight away. 
> Using Google I found that for the other signals I needed to modify the 
> events mask on the command tab of the properties window. I selected 
> GDK_EXPOSURE_MASK, GDK_POINTER_MOTION_MASK, 
> GDK_POINTER_MOTION_HINT_MASK and GDK_BUTTON_PRESS_MASK.
>
> This didn't work which I thought was a little odd. If, after loading 
> the Glade file, I call add_events for the drawing area widget and add 
> each of the above events it almost works. The button press events 
> occur but the motion events are borken. When I enter the window I see 
> a single motion event. When I move the mouse after a button press I 
> see a single motion event. I think I should see motion events 
> repeatedly as I move the mouse about over the drawing area but it's 
> not happening.
>
> There's a pygtk demo app called Scribble which handles all these 
> events. It doesn't use Glade.
>
> Help?
>
> _______________________________________________
> Glade-users maillist  -  Glade-users@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/glade-users
>