Gtk.GestureMultiPress

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

Subclasses:

None

Methods

Inherited:

Gtk.GestureSingle (8), Gtk.Gesture (19), Gtk.EventController (5), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (widget)

get_area ()

set_area (rect)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Gtk.GestureSingle (3), Gtk.Gesture (2), Gtk.EventController (2)

Signals

Inherited:

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

Name

Short Description

pressed

This signal is emitted whenever a button or touch press happens.

released

This signal is emitted when a button or touch is released.

stopped

This signal is emitted whenever any time/distance threshold has been exceeded.

Fields

Inherited:

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

Class Details

class Gtk.GestureMultiPress(**kwargs)
Bases:

Gtk.GestureSingle

Abstract:

No

Structure:

Gtk.GestureMultiPressClass

Gtk.GestureMultiPress is a Gtk.Gesture implementation able to recognize multiple clicks on a nearby zone, which can be listened for through the Gtk.GestureMultiPress ::pressed signal. Whenever time or distance between clicks exceed the GTK+ defaults, Gtk.GestureMultiPress ::stopped is emitted, and the click counter is reset.

Callers may also restrict the area that is considered valid for a >1 touch/button press through Gtk.GestureMultiPress.set_area(), so any click happening outside that area is considered to be a first click of its own.

classmethod new(widget)[source]
Parameters:

widget (Gtk.Widget) – a Gtk.Widget

Returns:

a newly created Gtk.GestureMultiPress

Return type:

Gtk.Gesture

Returns a newly created Gtk.Gesture that recognizes single and multiple presses.

New in version 3.14.

get_area()[source]
Returns:

True if rect was filled with the press area

rect:

return location for the press area

Return type:

(bool, rect: Gdk.Rectangle)

If an area was set through Gtk.GestureMultiPress.set_area(), this function will return True and fill in rect with the press area. See Gtk.GestureMultiPress.set_area() for more details on what the press area represents.

New in version 3.14.

set_area(rect)[source]
Parameters:

rect (Gdk.Rectangle or None) – rectangle to receive coordinates on

If rect is non-None, the press area will be checked to be confined within the rectangle, otherwise the button count will be reset so the press is seen as being the first one. If rect is None, the area will be reset to an unrestricted state.

Note: The rectangle is only used to determine whether any non-first click falls within the expected area. This is not akin to an input shape.

New in version 3.14.

Signal Details

Gtk.GestureMultiPress.signals.pressed(gesture_multi_press, n_press, x, y)
Signal Name:

pressed

Flags:

RUN_LAST

Parameters:
  • gesture_multi_press (Gtk.GestureMultiPress) – The object which received the signal

  • n_press (int) – how many touch/button presses happened with this one

  • x (float) – The X coordinate, in widget allocation coordinates

  • y (float) – The Y coordinate, in widget allocation coordinates

This signal is emitted whenever a button or touch press happens.

New in version 3.14.

Gtk.GestureMultiPress.signals.released(gesture_multi_press, n_press, x, y)
Signal Name:

released

Flags:

RUN_LAST

Parameters:
  • gesture_multi_press (Gtk.GestureMultiPress) – The object which received the signal

  • n_press (int) – number of press that is paired with this release

  • x (float) – The X coordinate, in widget allocation coordinates

  • y (float) – The Y coordinate, in widget allocation coordinates

This signal is emitted when a button or touch is released. n_press will report the number of press that is paired to this event, note that Gtk.GestureMultiPress ::stopped may have been emitted between the press and its release, n_press will only start over at the next press.

New in version 3.14.

Gtk.GestureMultiPress.signals.stopped(gesture_multi_press)
Signal Name:

stopped

Flags:

RUN_LAST

Parameters:

gesture_multi_press (Gtk.GestureMultiPress) – The object which received the signal

This signal is emitted whenever any time/distance threshold has been exceeded.

New in version 3.14.