GestureLongPress#

class GestureLongPress(**properties: Any)#

Superclasses: GestureSingle, Gesture, EventController, Object

Recognizes long press gestures.

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

When the timeout is exceeded, the gesture is triggering the pressed signal.

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

How long the timeout is before the ::pressed signal gets emitted is determined by the gtk_long_press_time setting. It can be modified by the delay_factor property.

Constructors#

class GestureLongPress
classmethod new() Gesture#

Returns a newly created GtkGesture that recognizes long presses.

Methods#

class GestureLongPress
get_delay_factor() float#

Returns the delay factor.

set_delay_factor(delay_factor: float) None#

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].

Parameters:

delay_factor – The delay factor to apply

Properties#

class GestureLongPress
props.delay_factor: float#

Factor by which to modify the default timeout.

Signals#

class GestureLongPress.signals
cancelled() None#

Emitted whenever a press moved too far, or was released before pressed happened.

pressed(x: float, y: float) None#

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

Parameters:
  • x – the X coordinate where the press happened, relative to the widget allocation

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