:right-sidebar: True GestureLongPress =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: GestureLongPress(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.GestureSingle`, :class:`~gi.repository.Gtk.Gesture`, :class:`~gi.repository.Gtk.EventController`, :class:`~gi.repository.GObject.Object` ``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 :obj:`~gi.repository.Gtk.GestureLongPress.signals.pressed` signal. If the touchpoint is lifted before the timeout passes, or if it drifts too far of the initial press point, the :obj:`~gi.repository.Gtk.GestureLongPress.signals.cancelled` signal will be emitted. How long the timeout is before the ::pressed signal gets emitted is determined by the :obj:`~gi.repository.Gtk.Settings.props.gtk_long_press_time` setting. It can be modified by the :obj:`~gi.repository.Gtk.GestureLongPress.props.delay_factor` property. Constructors ------------ .. rst-class:: interim-class .. class:: GestureLongPress :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Gesture Returns a newly created ``GtkGesture`` that recognizes long presses. Methods ------- .. rst-class:: interim-class .. class:: GestureLongPress :no-index: .. method:: get_delay_factor() -> float Returns the delay factor. .. method:: 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]. :param delay_factor: The delay factor to apply Properties ---------- .. rst-class:: interim-class .. class:: GestureLongPress :no-index: .. attribute:: props.delay_factor :type: float Factor by which to modify the default timeout. Signals ------- .. rst-class:: interim-class .. class:: GestureLongPress.signals :no-index: .. method:: cancelled() -> None Emitted whenever a press moved too far, or was released before :obj:`~gi.repository.Gtk.GestureLongPress.signals.pressed` happened. .. method:: pressed(x: float, y: float) -> None Emitted whenever a press goes unmoved/unreleased longer than what the GTK defaults tell. :param x: the X coordinate where the press happened, relative to the widget allocation :param y: the Y coordinate where the press happened, relative to the widget allocation