GtkEventControllerMotion — Event controller for motion events
gboolean | contains-pointer | Read |
gboolean | is-pointer | Read |
GObject ╰── GtkEventController ╰── GtkEventControllerMotion
#include <gtk/gtk.h>
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.
a new GtkEventControllerMotion
gboolean
gtk_event_controller_motion_contains_pointer
(GtkEventControllerMotion *self
);
Returns the value of the GtkEventControllerMotion:contains-pointer property.
self |
TRUE
if a pointer is within self
or one of its children
gboolean
gtk_event_controller_motion_is_pointer
(GtkEventControllerMotion *self
);
Returns the value of the GtkEventControllerMotion:is-pointer property.
self |
TRUE
if a pointer is within self
but not one of its children
typedef struct _GtkEventControllerMotion GtkEventControllerMotion;
“contains-pointer”
property“contains-pointer” gboolean
Whether the pointer is in the controllers widget or a descendant. See also “is-pointer”.
When handling crossing events, this property is updated before “enter” but after “leave” is emitted.
Owner: GtkEventControllerMotion
Flags: Read
Default value: FALSE
“is-pointer”
property“is-pointer” gboolean
Whether the pointer is in the controllers widget itself, as opposed to in a descendent widget. See also “contains-pointer”.
When handling crossing events, this property is updated before “enter” but after “leave” is emitted.
Owner: GtkEventControllerMotion
Flags: Read
Default value: FALSE
“enter”
signalvoid user_function (GtkEventControllerMotion *controller, double x, double y, gpointer user_data)
Signals that the pointer has entered the widget.
controller | the object which received the signal | |
x | coordinates of pointer location | |
y | coordinates of pointer location | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
“leave”
signalvoid user_function (GtkEventControllerMotion *controller, gpointer user_data)
Signals that the pointer has left the widget.
controller | the object which received the signal | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
“motion”
signalvoid user_function (GtkEventControllerMotion *controller, double x, double 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
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkEventControllerMotion.html