Gtk.GestureLongPress

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.GestureLongPress Gtk.GestureLongPress Gtk.GestureSingle->Gtk.GestureLongPress

Subclasses:

None

Methods

Inherited:

Gtk.GestureSingle (8), Gtk.Gesture (17), Gtk.EventController (13), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

get_delay_factor ()

set_delay_factor (delay_factor)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

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

Name

Type

Flags

Short Description

delay-factor

float

r/w/en

Signals

Inherited:

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

Name

Short Description

cancelled

Emitted whenever a press moved too far, or was released before [signal`Gtk`.GestureLongPress::pressed] happened.

pressed

Emitted whenever a press goes unmoved/unreleased longer than what the GTK defaults tell.

Fields

Inherited:

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

Class Details

class Gtk.GestureLongPress(**kwargs)
Bases:

Gtk.GestureSingle

Abstract:

No

Structure:

Gtk.GestureLongPressClass

GtkGestureLongPress is a GtkGesture for long presses.

This gesture is also known as “Press and Hold”.

When the timeout is exceeded, the gesture is triggering the [signal`Gtk`.GestureLongPress::pressed] signal.

If the touchpoint is lifted before the timeout passes, or if it drifts too far of the initial press point, the [signal`Gtk`.GestureLongPress::cancelled] signal will be emitted.

How long the timeout is before the ::pressed signal gets emitted is determined by the [property`Gtk`.Settings:gtk-long-press-time] setting. It can be modified by the [property`Gtk`.GestureLongPress:delay-factor] property.

classmethod new()[source]
Returns:

a newly created GtkGestureLongPress.

Return type:

Gtk.Gesture

Returns a newly created GtkGesture that recognizes long presses.

get_delay_factor()[source]
Returns:

the delay factor

Return type:

float

Returns the delay factor.

set_delay_factor(delay_factor)[source]
Parameters:

delay_factor (float) – The delay factor to apply

Applies the given delay factor.

The default long press time will be multiplied by this value. Valid values are in the range [0.5..2.0].

Signal Details

Gtk.GestureLongPress.signals.cancelled(gesture_long_press)
Signal Name:

cancelled

Flags:

RUN_LAST

Parameters:

gesture_long_press (Gtk.GestureLongPress) – The object which received the signal

Emitted whenever a press moved too far, or was released before [signal`Gtk`.GestureLongPress::pressed] happened.

Gtk.GestureLongPress.signals.pressed(gesture_long_press, x, y)
Signal Name:

pressed

Flags:

RUN_LAST

Parameters:
  • gesture_long_press (Gtk.GestureLongPress) – The object which received the signal

  • x (float) – the X coordinate where the press happened, relative to the widget allocation

  • y (float) – the Y coordinate where the press happened, relative to the widget allocation

Emitted whenever a press goes unmoved/unreleased longer than what the GTK defaults tell.

Property Details

Gtk.GestureLongPress.props.delay_factor
Name:

delay-factor

Type:

float

Default Value:

1.0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Factor by which to modify the default timeout.