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 (17), Gtk.EventController (13), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (orientation)

get_orientation ()

set_orientation (orientation)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

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

Name

Type

Flags

Short Description

orientation

Gtk.Orientation

r/w/en

Signals

Inherited:

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

Name

Short Description

pan

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

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 [method`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 [signal`Gtk`.GesturePan::pan] signal will be emitted as input events are received, containing the offset in the given axis.

classmethod new(orientation)[source]
Parameters:

orientation (Gtk.Orientation) – expected orientation

Returns:

a newly created GtkGesturePan

Return type:

Gtk.Gesture

Returns a newly created GtkGesture that recognizes pan gestures.

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.

set_orientation(orientation)[source]
Parameters:

orientation (Gtk.Orientation) – expected orientation

Sets the orientation to be expected on pan gestures.

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

Emitted once a panning gesture along the expected axis is detected.

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.