GDK_POINTER_MOTION_HINT_MASK?



Hi All,

The short question: I want to use GTK_POINTER_MOTION_HINT_MASK, but I don't 
know how.

The long question: I have a scrolled window, in which I pack a custom NO_WINDOW 
widget. On the scrolled window's viewport, I turn on POINTER_MOTION events, and 
set a callback for that. The callback, however, can sometimes take relatively 
much time (a lot more than the time between two POINTER_MOTION events). It 
seems like POINTER_MOTION_HINT would be the solution. Only, how do I use it? 
What I have now:
  gtk_widget_set_events( viewport, gtk_widget_get_events( viewport ) |
			 GDK_POINTER_MOTION_HINT_MASK | 
			 GDK_LEAVE_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK );
Connect the "motion_notify_event", "leave_notify_event" and 
"enter_notify_event" to some callback function. In that callback function, if 
it's a GDK_ENTER_NOTIFY, do a gdk_window_get_pointer, so we'll receive 
POINTER_MOTION events (but we don't). (Also call gdk_window_get_pointer after 
processing a GDK_MOTION_NOTIFY event, so we'll get another one. But we never 
get the first one.) So the question is: (What am I doing wrong?) Why don't I 
get that initial GDK_MOTION_NOTIFY event? What do I have to do to get 
MOTION_NOTIFY events, given that POINTER_MOTION_HINT_MASK is set?

My apologies if this is somewhere in the tutorial, but I didn't see it. (But 
perhaps it would be useful to have this explanation somewhere? Seeing as how 
the list archives don't seem to have any search functionality.)

Thanks,

Johannes.

--
"In wildness is the preservation of the world
 So seek the wolf in thyself" - Metallica

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]