Top |
Description
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.
Functions
gtk_drop_controller_motion_new ()
GtkEventController *
gtk_drop_controller_motion_new (void
);
Creates a new event controller that will handle pointer motion events during drag and drop.
gtk_drop_controller_motion_contains_pointer ()
gboolean
gtk_drop_controller_motion_contains_pointer
(GtkDropControllerMotion *self
);
Returns the value of the GtkDropControllerMotion:contains-pointer property.
gtk_drop_controller_motion_is_pointer ()
gboolean
gtk_drop_controller_motion_is_pointer (GtkDropControllerMotion *self
);
Returns the value of the GtkDropControllerMotion:is-pointer property.
gtk_drop_controller_motion_get_drop ()
GdkDrop *
gtk_drop_controller_motion_get_drop (GtkDropControllerMotion *self
);
Returns the value of the GtkDropControllerMotion:drop property.
Property Details
The “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
The “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
The “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
Signal Details
The “enter”
signal
void user_function (GtkDropControllerMotion *self, double x, double y, gpointer user_data)
Signals that the pointer has entered the widget.
Parameters
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
The “leave”
signal
void user_function (GtkDropControllerMotion *self, gpointer user_data)
Signals that the pointer has left the widget.
Parameters
self |
the object which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
The “motion”
signal
void user_function (GtkDropControllerMotion *self, double x, double y, gpointer user_data)
Emitted when the pointer moves inside the widget.
Parameters
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