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

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.


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


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 

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.


Glade-users maillist  -  Glade-users lists ximian com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]