Re: [gtk-list] GDK_POINTER_MOTION_HINT_MASK and buttons



//I capture the motion signal like this:
//================================================
//      gtk_widget_set_events (button,
//			     GDK_ENTER_NOTIFY_MASK |
//			     GDK_LEAVE_NOTIFY_MASK |
//			     GDK_MOTION_NOTIFY |
//			     GDK_POINTER_MOTION_HINT_MASK |
//			     GDK_BUTTON_PRESS_MASK);
//      gtk_signal_connect (GTK_OBJECT (button),
//			  "motion_notify_event",
//			  (GtkSignalFunc) z_widget_move,
//			  NULL);

When using GDK_POINTER_MOTION_HINT_MASK, you only get new GDK_MOTION_NOTIFY 
events after a call to gdk_window_get_pointer. So in your callback, when event->
is_hint is set, call gdk_window_get_pointer to get the mouse coordinates. 
(Plus, I _think_ that if is_hint is set, the coordinates in the event don't 
make any sense. Anyone know this for sure?)

Good luck!

Johannes.

--
"Lisp has all the visual appeal of oatmeal with fingernail clippings mixed in."
	--Larry Wall in <1994Jul21.173737.16853@netlabs.com>

How do I connect to that real-life thing I keep hearing about?




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