:right-sidebar: True GesturePan =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: GesturePan(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.GestureDrag`, :class:`~gi.repository.Gtk.GestureSingle`, :class:`~gi.repository.Gtk.Gesture`, :class:`~gi.repository.Gtk.EventController`, :class:`~gi.repository.GObject.Object` ``GtkGesturePan`` is a ``GtkGesture`` for pan gestures. These are drags that are locked to happen along one axis. The axis that a ``GtkGesturePan`` handles is defined at construct time, and can be changed through :obj:`~gi.repository.Gtk.GesturePan.set_orientation`. When the gesture starts to be recognized, ``GtkGesturePan`` will attempt to determine as early as possible whether the sequence is moving in the expected direction, and denying the sequence if this does not happen. Once a panning gesture along the expected axis is recognized, the :obj:`~gi.repository.Gtk.GesturePan.signals.pan` signal will be emitted as input events are received, containing the offset in the given axis. Constructors ------------ .. rst-class:: interim-class .. class:: GesturePan :no-index: .. classmethod:: new(orientation: ~gi.repository.Gtk.Orientation) -> ~gi.repository.Gtk.Gesture Returns a newly created ``GtkGesture`` that recognizes pan gestures. :param orientation: expected orientation Methods ------- .. rst-class:: interim-class .. class:: GesturePan :no-index: .. method:: get_orientation() -> ~gi.repository.Gtk.Orientation Returns the orientation of the pan gestures that this ``gesture`` expects. .. method:: set_orientation(orientation: ~gi.repository.Gtk.Orientation) -> None Sets the orientation to be expected on pan gestures. :param orientation: expected orientation Properties ---------- .. rst-class:: interim-class .. class:: GesturePan :no-index: .. attribute:: props.orientation :type: ~gi.repository.Gtk.Orientation The expected orientation of pan gestures. Signals ------- .. rst-class:: interim-class .. class:: GesturePan.signals :no-index: .. method:: pan(direction: ~gi.repository.Gtk.PanDirection, offset: float) -> None Emitted once a panning gesture along the expected axis is detected. :param direction: current direction of the pan gesture :param offset: Offset along the gesture orientation