:right-sidebar: True GestureDrag =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: GestureDrag(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.GestureSingle`, :class:`~gi.repository.Gtk.Gesture`, :class:`~gi.repository.Gtk.EventController`, :class:`~gi.repository.GObject.Object` Subclasses: :class:`~gi.repository.Gtk.GesturePan` ``GtkGestureDrag`` is a ``GtkGesture`` implementation for drags. The drag operation itself can be tracked throughout the :obj:`~gi.repository.Gtk.GestureDrag.signals.drag_begin`\, :obj:`~gi.repository.Gtk.GestureDrag.signals.drag_update` and :obj:`~gi.repository.Gtk.GestureDrag.signals.drag_end` signals, and the relevant coordinates can be extracted through :obj:`~gi.repository.Gtk.GestureDrag.get_offset` and :obj:`~gi.repository.Gtk.GestureDrag.get_start_point`\. Constructors ------------ .. rst-class:: interim-class .. class:: GestureDrag :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Gesture Returns a newly created ``GtkGesture`` that recognizes drags. Methods ------- .. rst-class:: interim-class .. class:: GestureDrag :no-index: .. method:: get_offset() -> ~typing.Tuple[bool, float, float] Gets the offset from the start point. If the ``gesture`` is active, this function returns :const:`True` and fills in ``x`` and ``y`` with the coordinates of the current point, as an offset to the starting drag point. .. method:: get_start_point() -> ~typing.Tuple[bool, float, float] Gets the point where the drag started. If the ``gesture`` is active, this function returns :const:`True` and fills in ``x`` and ``y`` with the drag start coordinates, in widget-relative coordinates. Signals ------- .. rst-class:: interim-class .. class:: GestureDrag.signals :no-index: .. method:: drag_begin(start_x: float, start_y: float) -> None The type of the None singleton. :param start_x: X coordinate, relative to the widget allocation :param start_y: Y coordinate, relative to the widget allocation .. method:: drag_end(offset_x: float, offset_y: float) -> None The type of the None singleton. :param offset_x: X offset, relative to the start point :param offset_y: Y offset, relative to the start point .. method:: drag_update(offset_x: float, offset_y: float) -> None The type of the None singleton. :param offset_x: X offset, relative to the start point :param offset_y: Y offset, relative to the start point