Gtk.GestureDrag

g GObject.Object GObject.Object Gtk.EventController Gtk.EventController GObject.Object->Gtk.EventController Gtk.Gesture Gtk.Gesture Gtk.EventController->Gtk.Gesture Gtk.GestureSingle Gtk.GestureSingle Gtk.Gesture->Gtk.GestureSingle Gtk.GestureDrag Gtk.GestureDrag Gtk.GestureSingle->Gtk.GestureDrag

Subclasses:

Gtk.GesturePan

Methods

Inherited:

Gtk.GestureSingle (8), Gtk.Gesture (17), Gtk.EventController (13), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

get_offset ()

get_start_point ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Gtk.GestureSingle (3), Gtk.Gesture (1), Gtk.EventController (4)

Signals

Inherited:

Gtk.Gesture (5), GObject.Object (1)

Name

Short Description

drag-begin

Emitted whenever dragging starts.

drag-end

Emitted whenever the dragging is finished.

drag-update

Emitted whenever the dragging point moves.

Fields

Inherited:

Gtk.Gesture (5), GObject.Object (1)

Class Details

class Gtk.GestureDrag(**kwargs)
Bases:

Gtk.GestureSingle

Abstract:

No

Structure:

Gtk.GestureDragClass

GtkGestureDrag is a GtkGesture implementation for drags.

The drag operation itself can be tracked throughout the [signal`Gtk`.GestureDrag::drag-begin], [signal`Gtk`.GestureDrag::drag-update] and [signal`Gtk`.GestureDrag::drag-end] signals, and the relevant coordinates can be extracted through [method`Gtk`.GestureDrag.get_offset] and [method`Gtk`.GestureDrag.get_start_point].

classmethod new()[source]
Returns:

a newly created GtkGestureDrag

Return type:

Gtk.Gesture

Returns a newly created GtkGesture that recognizes drags.

get_offset()[source]
Returns:

True if the gesture is active

x:

X offset for the current point

y:

Y offset for the current point

Return type:

(bool, x: float, y: float)

Gets the offset from the start point.

If the self 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.

get_start_point()[source]
Returns:

True if the gesture is active

x:

X coordinate for the drag start point

y:

Y coordinate for the drag start point

Return type:

(bool, x: float, y: float)

Gets the point where the drag started.

If the self is active, this function returns True and fills in x and y with the drag start coordinates, in widget-relative coordinates.

Signal Details

Gtk.GestureDrag.signals.drag_begin(gesture_drag, start_x, start_y)
Signal Name:

drag-begin

Flags:

RUN_LAST

Parameters:
  • gesture_drag (Gtk.GestureDrag) – The object which received the signal

  • start_x (float) – X coordinate, relative to the widget allocation

  • start_y (float) – Y coordinate, relative to the widget allocation

Emitted whenever dragging starts.

Gtk.GestureDrag.signals.drag_end(gesture_drag, offset_x, offset_y)
Signal Name:

drag-end

Flags:

RUN_LAST

Parameters:
  • gesture_drag (Gtk.GestureDrag) – The object which received the signal

  • offset_x (float) – X offset, relative to the start point

  • offset_y (float) – Y offset, relative to the start point

Emitted whenever the dragging is finished.

Gtk.GestureDrag.signals.drag_update(gesture_drag, offset_x, offset_y)
Signal Name:

drag-update

Flags:

RUN_LAST

Parameters:
  • gesture_drag (Gtk.GestureDrag) – The object which received the signal

  • offset_x (float) – X offset, relative to the start point

  • offset_y (float) – Y offset, relative to the start point

Emitted whenever the dragging point moves.