![]() |
![]() |
![]() |
![]() |
GtkEventControllerMotion is an event controller meant for situations where you need to track the position of the pointer.
GtkEventController *
gtk_event_controller_motion_new (void
);
Creates a new event controller that will handle motion events.
GtkWidget *
gtk_event_controller_motion_get_pointer_origin
(GtkEventControllerMotion *controller
);
Returns the widget that contained the pointer before.
This function can only be used in handlers for the “enter” and “leave” signals.
GtkWidget *
gtk_event_controller_motion_get_pointer_target
(GtkEventControllerMotion *controller
);
Returns the widget that will contain the pointer afterwards.
This function can only be used in handlers for the “enter” and “leave” signals.
“contains-pointer-focus”
property“contains-pointer-focus” gboolean
Whether the pointer is in a descendant of the controllers widget. See “is-pointer-focus”.
When handling crossing events, this property is updated before “enter” or “leave” are emitted.
Owner: GtkEventControllerMotion
Flags: Read
Default value: FALSE
“is-pointer-focus”
property“is-pointer-focus” gboolean
Whether the pointer is in the controllers widget itself, as opposed to in a descendent widget. See “contains-pointer-focus”.
When handling crossing events, this property is updated before “enter” or “leave” are emitted.
Owner: GtkEventControllerMotion
Flags: Read
Default value: FALSE
“enter”
signalvoid user_function (GtkEventControllerMotion *controller, gdouble x, gdouble y, GdkCrossingMode crossing_mode, GdkNotifyType notify_type, gpointer user_data)
Signals that the pointer has entered the widget.
controller |
The object that received the signal |
|
x |
the x coordinate |
|
y |
the y coordinate |
|
crossing_mode |
the crossing mode of this event |
|
notify_type |
the kind of crossing event |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“leave”
signalvoid user_function (GtkEventControllerMotion *controller, GdkCrossingMode crossing_mode, GdkNotifyType notify_type, gpointer user_data)
Signals that pointer has left the widget.
controller |
The object that received the signal |
|
crossing_mode |
the crossing mode of this event |
|
notify_type |
the kind of crossing event |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“motion”
signalvoid user_function (GtkEventControllerMotion *controller, gdouble x, gdouble y, gpointer user_data)
Emitted when the pointer moves inside the widget.
controller |
The object that received the signal |
|
x |
the x coordinate |
|
y |
the y coordinate |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First