Basics
Guides
API Reference
Basics
Guides
API Reference
[258:14] static extends: object
Generated metadata helpers for GestureSingle class surfaces.
properties ()
Returns property metadata for
GestureSingle.
A list.[22:7] extends: object
A GtkGesture subclass optimized for singe-touch and mouse gestures. Under
interaction, these gestures stick to the first interacting sequence, which is
accessible through [method@Gtk.GestureSingle.get_current_sequence] while the
gesture is being interacted with. By default gestures react to both
%GDK_BUTTON_PRIMARY and touch events.
[method@Gtk.GestureSingle.set_touch_only] can be used to change the touch
behavior. Callers may also specify a different mouse button number to
interact with through [method@Gtk.GestureSingle.set_button], or react to any
mouse button by setting it to 0. While the gesture is active, the button
being currently pressed can be known through
[method@Gtk.GestureSingle.get_current_button].
GestureSingle (Handle = null)
Creates a new
GestureSingleby wrapping a native handle or another wrapper.
Handle is the native handle or another wrapper whose handle to adopt.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asGesture ()
Wraps this handle as
Gesture.
A Gesture object.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setButton (int Value)
Mouse button number to listen to, or 0 to listen for any button.
Value is the new property value.None.setExclusive (bool Value)
Whether the gesture is exclusive. Exclusive gestures only listen to pointer and pointer emulated events.
Value is the new property value.None.setTouchonly (bool Value)
Whether the gesture handles only touch events.
Value is the new property value.None.get_button ()
Returns the button number @gesture listens for. If this is 0, the gesture reacts to any button press.
get_current_button ()
Returns the button number currently interacting with @gesture, or 0 if there is none.
get_current_sequence ()
Returns the event sequence currently interacting with @gesture. This is only meaningful if [method@Gtk.Gesture.is_active] returns %TRUE.
get_exclusive ()
Gets whether a gesture is exclusive. For more information, see [method@Gtk.GestureSingle.set_exclusive].
get_touch_only ()
Returns %TRUE if the gesture is only triggered by touch events.
set_button (int button)
Sets the button number @gesture listens to. If non-0, every button press from a different button number will be ignored. Touch events implicitly match with button 1.
button is button number to listen to, or 0 for any button.None.set_exclusive (bool exclusive)
Sets whether @gesture is exclusive. An exclusive gesture will only handle pointer and "pointer emulated" touch events, so at any given time, there is only one sequence able to interact with those.
exclusive is %TRUE to make @gesture exclusive.None.set_touch_only (bool touch_only)
Sets whether to handle only touch events. If @touch_only is %TRUE,
will only handle events of type %GDK_TOUCH_BEGIN, %GDK_TOUCH_UPDATE or %GDK_TOUCH_END. If %FALSE, mouse events will be handled too.touch_only is whether @gesture handles only touch events.None.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.