GtkGestureDrag

GtkGestureDrag — Drag gesture

Functions

Types and Values

Includes

#include <gtk/gtk.h>

Description

GtkGestureDrag is a GtkGesture implementation that recognizes drag operations. The drag operation itself can be tracked throught 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 (GtkWidget *widget);

Returns a newly created GtkGesture that recognizes drags.

Parameters

widget

a GtkWidget

 

Returns

a newly created GtkGestureDrag

Since: 3.14


gtk_gesture_drag_get_start_point ()

gboolean
gtk_gesture_drag_get_start_point (GtkGestureDrag *gesture,
                                  gdouble *x,
                                  gdouble *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.

Parameters

gesture

a GtkGesture

 

x

X coordinate for the drag start point.

[out][nullable]

y

Y coordinate for the drag start point.

[out][nullable]

Returns

TRUE if the gesture is active

Since: 3.14


gtk_gesture_drag_get_offset ()

gboolean
gtk_gesture_drag_get_offset (GtkGestureDrag *gesture,
                             gdouble *x,
                             gdouble *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.

Parameters

gesture

a GtkGesture

 

x

X offset for the current point.

[out][nullable]

y

Y offset for the current point.

[out][nullable]

Returns

TRUE if the gesture is active

Since: 3.14

Types and Values

GtkGestureDrag

typedef struct _GtkGestureDrag GtkGestureDrag;

See Also

GtkGestureSwipe