Top |
Functions
GtkGesture * | gtk_gesture_drag_new () |
gboolean | gtk_gesture_drag_get_start_point () |
gboolean | gtk_gesture_drag_get_offset () |
Object Hierarchy
GObject ╰── GtkEventController ╰── GtkGesture ╰── GtkGestureSingle ╰── GtkGestureDrag ╰── GtkGesturePan
Description
GtkGestureDrag is a GtkGesture implementation that recognizes drag
operations. The drag operation itself can be tracked throughout the
“drag-begin”, “drag-update” and
“drag-end” signals, or the relevant coordinates be
extracted through gtk_gesture_drag_get_offset()
and
gtk_gesture_drag_get_start_point()
.
Functions
gtk_gesture_drag_new ()
GtkGesture *
gtk_gesture_drag_new (void
);
Returns a newly created GtkGesture that recognizes drags.
gtk_gesture_drag_get_start_point ()
gboolean gtk_gesture_drag_get_start_point (GtkGestureDrag *gesture
,double *x
,double *y
);
If the gesture
is active, this function returns TRUE
and fills in x
and y
with the drag start coordinates,
in window-relative coordinates.
gtk_gesture_drag_get_offset ()
gboolean gtk_gesture_drag_get_offset (GtkGestureDrag *gesture
,double *x
,double *y
);
If the gesture
is active, this function returns TRUE
and
fills in x
and y
with the coordinates of the current point,
as an offset to the starting drag point.
Signal Details
The “drag-begin”
signal
void user_function (GtkGestureDrag *gesture, double start_x, double start_y, gpointer user_data)
This signal is emitted whenever dragging starts.
Parameters
gesture |
the object which received the signal |
|
start_x |
X coordinate, relative to the widget allocation |
|
start_y |
Y coordinate, relative to the widget allocation |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
The “drag-end”
signal
void user_function (GtkGestureDrag *gesture, double offset_x, double offset_y, gpointer user_data)
This signal is emitted whenever the dragging is finished.
Parameters
gesture |
the object which received the signal |
|
offset_x |
X offset, relative to the start point |
|
offset_y |
Y offset, relative to the start point |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
The “drag-update”
signal
void user_function (GtkGestureDrag *gesture, double offset_x, double offset_y, gpointer user_data)
This signal is emitted whenever the dragging point moves.
Parameters
gesture |
the object which received the signal |
|
offset_x |
X offset, relative to the start point |
|
offset_y |
Y offset, relative to the start point |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last