Top | ![]() |
![]() |
![]() |
![]() |
GtkDropControllerMotion is an event controller meant for tracking the pointer hovering over a widget during a drag and drop operation.
It is modeled after GtkEventControllerMotion so if you have used that, this should feel really familiar.
The drop controller is not able to accept drops, use GtkDropTarget for that purpose.
GtkEventController *
gtk_drop_controller_motion_new (void
);
Creates a new event controller that will handle pointer motion events during drag and drop.
gboolean
gtk_drop_controller_motion_contains_pointer
(GtkDropControllerMotion *self
);
Returns the value of the GtkDropControllerMotion:contains-pointer property.
gboolean
gtk_drop_controller_motion_is_pointer (GtkDropControllerMotion *self
);
Returns the value of the GtkDropControllerMotion:is-pointer property.
GdkDrop *
gtk_drop_controller_motion_get_drop (GtkDropControllerMotion *self
);
Returns the value of the GtkDropControllerMotion:drop property.
“contains-pointer”
property“contains-pointer” gboolean
Whether the pointer of a drag and drop operation is in the controller's widget or a descendant. See also “is-pointer”.
When handling crossing events, this property is updated before “enter” but after “leave” is emitted.
Owner: GtkDropControllerMotion
Flags: Read
Default value: FALSE
“drop”
property“drop” GdkDrop *
The ongoing drop operation over the controller's widget or its descendant.
If no drop operation is going on, this property returns NULL
.
The event controller should not modify the drop
, but it might want to query
its properties.
When handling crossing events, this property is updated before “enter” but after “leave” is emitted.
Owner: GtkDropControllerMotion
Flags: Read
“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: GtkDropControllerMotion
Flags: Read
Default value: FALSE
“enter”
signalvoid user_function (GtkDropControllerMotion *self, double x, double y, gpointer user_data)
Signals that the pointer has entered the widget.
self |
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 (GtkDropControllerMotion *self, gpointer user_data)
Signals that the pointer has left the widget.
self |
the object which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“motion”
signalvoid user_function (GtkDropControllerMotion *self, double x, double y, gpointer user_data)
Emitted when the pointer moves inside the widget.
self |
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