Gtk.GesturePan

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.GesturePan Gtk.GesturePan Gtk.GestureDrag->Gtk.GesturePan Gtk.GestureSingle->Gtk.GestureDrag

Subclasses:

None

Methods

Inherited:

Gtk.GestureDrag (3), Gtk.GestureSingle (8), Gtk.Gesture (19), Gtk.EventController (5), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (widget, orientation)

get_orientation ()

set_orientation (orientation)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Gtk.GestureSingle (3), Gtk.Gesture (2), Gtk.EventController (2)

Name

Type

Flags

Short Description

orientation

Gtk.Orientation

r/w/en

Allowed orientations

Signals

Inherited:

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

Name

Short Description

pan

This signal is emitted once a panning gesture along the expected axis is detected.

Fields

Inherited:

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

Class Details

class Gtk.GesturePan(**kwargs)
Bases:

Gtk.GestureDrag

Abstract:

No

Structure:

Gtk.GesturePanClass

Gtk.GesturePan is a Gtk.Gesture implementation able to recognize pan gestures, those are drags that are locked to happen along one axis. The axis that a Gtk.GesturePan handles is defined at construct time, and can be changed through Gtk.GesturePan.set_orientation().

When the gesture starts to be recognized, Gtk.GesturePan 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 Gtk.GesturePan ::pan signal will be emitted as input events are received, containing the offset in the given axis.

classmethod new(widget, orientation)[source]
Parameters:
Returns:

a newly created Gtk.GesturePan

Return type:

Gtk.Gesture

Returns a newly created Gtk.Gesture that recognizes pan gestures.

New in version 3.14.

get_orientation()[source]
Returns:

the expected orientation for pan gestures

Return type:

Gtk.Orientation

Returns the orientation of the pan gestures that this self expects.

New in version 3.14.

set_orientation(orientation)[source]
Parameters:

orientation (Gtk.Orientation) – expected orientation

Sets the orientation to be expected on pan gestures.

New in version 3.14.

Signal Details

Gtk.GesturePan.signals.pan(gesture_pan, direction, offset)
Signal Name:

pan

Flags:

RUN_LAST

Parameters:
  • gesture_pan (Gtk.GesturePan) – The object which received the signal

  • direction (Gtk.PanDirection) – current direction of the pan gesture

  • offset (float) – Offset along the gesture orientation

This signal is emitted once a panning gesture along the expected axis is detected.

New in version 3.14.

Property Details

Gtk.GesturePan.props.orientation
Name:

orientation

Type:

Gtk.Orientation

Default Value:

Gtk.Orientation.HORIZONTAL

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The expected orientation of pan gestures.

New in version 3.14.