GtkGesturePan: GTK+ 3 Reference Manual

## GtkGesturePan GtkGesturePan — Pan gesture |

## Functions

GtkGesture * | gtk_gesture_pan_new ()
GtkOrientation | gtk_gesture_pan_get_orientation ()
void | gtk_gesture_pan_set_orientation ()

## Properties

GtkOrientation | orientation | Read / Write

## Signals

void | pan | Run Last

## Types and Values

| GtkGesturePan
enum | GtkPanDirection

## Object Hierarchy

        GObject
        ╰── GtkEventController
            ╰── GtkGesture
                ╰── GtkGestureSingle
                    ╰── GtkGestureDrag
                        ╰── GtkGesturePan

## Includes

    #include <gtk/gtk.h>

## Description

GtkGesturePan is a GtkGesture implementation able to recognize pan gestures, those 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 `gtk_gesture_pan_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 “pan” signal will be emitted as input events are received, containing the offset in the given axis.

## Functions

### gtk_gesture_pan_new ()

    GtkGesture *
    gtk_gesture_pan_new (GtkWidget *widget,
                         GtkOrientation orientation);

Returns a newly created GtkGesture that recognizes pan gestures.

#### Parameters

widget | a GtkWidget |
orientation | expected orientation |

#### Returns

a newly created GtkGesturePan

Since: 3.14

### gtk_gesture_pan_get_orientation ()

    GtkOrientation
    gtk_gesture_pan_get_orientation (GtkGesturePan *gesture);

Returns the orientation of the pan gestures that this `gesture` expects.

#### Parameters

gesture | A GtkGesturePan |

#### Returns

the expected orientation for pan gestures

Since: 3.14

### gtk_gesture_pan_set_orientation ()

    void
    gtk_gesture_pan_set_orientation (GtkGesturePan *gesture,
                                     GtkOrientation orientation);

Sets the orientation to be expected on pan gestures.

#### Parameters

gesture | A GtkGesturePan |
orientation | expected orientation |

Since: 3.14

## Property Details

### The `“orientation”` property

      “orientation”              GtkOrientation

The expected orientation of pan gestures.

Owner: GtkGesturePan

Flags: Read / Write

Default value: GTK_ORIENTATION_HORIZONTAL

Since: 3.14

## Signal Details

### The `“pan”` signal

    void
    user_function (GtkGesturePan  *gesture,
                   GtkPanDirection direction,
                   gdouble         offset,
                   gpointer        user_data)

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

#### Parameters

gesture | The object which received the signal |
direction | current direction of the pan gesture |
offset | Offset along the gesture orientation |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.14