Re: "motion-notify-event"
- From: Luca Cappa <luca cappa i-medlab com>
- To: gtk-list gnome org
- Subject: Re: "motion-notify-event"
- Date: Tue, 20 Sep 2005 18:16:14 +0200
gtk_widget_add_events(window,GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK);
A few more questions on GtkEvent:
There are 2 ways I can get data of mouse position: event->button.x or
event->motion.x. Out of these two, which one should be used to capture
the location of the mouse pointer relative to the window.
the .x/.y of the second one, if you meant it is a GdkEventMotion.
Some examples use the following piece of code too:
if(event->is_hint)
gdk_window_get_pointer(window,&x.&y,&state);
You should either remove the GDK_POINTER_MOTION_HINT_MASK); flag above,
or instead use the code above you shown just at the start of your
motion_notify_event handler.
Luca
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]