Basics
Guides
API Reference
Basics
Guides
API Reference
[15:7] extends: object
A GtkShortcutsShortcut represents a single keyboard shortcut or gesture
with a short text. This widget is only meant to be used with
GtkShortcutsWindow.
ShortcutsShortcut (Handle = null)
Creates a new
ShortcutsShortcutby 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.asWidget ()
Wraps this handle as
Widget.
A Widget object.asAccessible ()
Wraps this handle as
Accessible.
A Accessible object.asBuildable ()
Wraps this handle as
Buildable.
A Buildable object.asConstraintTarget ()
Wraps this handle as
ConstraintTarget.
A ConstraintTarget object.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setAccelsizegroup (object Value)
The size group for the accelerator portion of this shortcut. This is used internally by GTK, and must not be modified by applications.
Value is the new property value.None.setAccelerator (string Value)
The accelerator(s) represented by this object. This property is used if [property@Gtk.ShortcutsShortcut:shortcut-type] is set to %GTK_SHORTCUT_ACCELERATOR. The syntax of this property is (an extension of) the syntax understood by [func@Gtk.accelerator_parse]. Multiple accelerators can be specified by separating them with a space, but keep in mind that the available width is limited. It is also possible to specify ranges of shortcuts, using
...between the keys. Sequences of keys can be specified using a+or&between the keys. Examples: - A single shortcut:<ctl><alt>delete- Two alternative shortcuts:<shift>a Home- A range of shortcuts:<alt>1...<alt>9- Several keys pressed together:Control_L&Control_R- A sequence of shortcuts or keys:<ctl>c+<ctl>xUse "+" instead of "&" when the keys may (or have to be) pressed sequentially (e.g use "t+t" for 'press the t key twice'). Note that<,>and&need to be escaped as<,> and& when used in .ui files.
Value is the new property value.None.setActionname (string Value)
A detailed action name. If this is set for a shortcut of type %GTK_SHORTCUT_ACCELERATOR, then GTK will use the accelerators that are associated with the action via [method@Gtk.Application.set_accels_for_action], and setting [property@Gtk.ShortcutsShortcut:accelerator] is not necessary.
Value is the new property value.None.setDirection (string Value)
The text direction for which this shortcut is active. If the shortcut is used regardless of the text direction, set this property to %GTK_TEXT_DIR_NONE.
Value is the new property value.None.setIcon (object Value)
An icon to represent the shortcut or gesture. This property is used if [property@Gtk.ShortcutsShortcut:shortcut-type] is set to %GTK_SHORTCUT_GESTURE. For the other predefined gesture types, GTK provides an icon on its own.
Value is the new property value.None.setIconset (bool Value)
%TRUE if an icon has been set.
Value is the new property value.None.setShortcuttype (string Value)
The type of shortcut that is represented.
Value is the new property value.None.setSubtitle (string Value)
The subtitle for the shortcut or gesture. This is typically used for gestures and should be a short, one-line text that describes the gesture itself. For the predefined gesture types, GTK provides a subtitle on its own.
Value is the new property value.None.setSubtitleset (bool Value)
%TRUE if a subtitle has been set.
Value is the new property value.None.setTitle (string Value)
The textual description for the shortcut or gesture represented by this object. This should be a short string that can fit in a single line.
Value is the new property value.None.setTitlesizegroup (object Value)
The size group for the textual portion of this shortcut. This is used internally by GTK, and must not be modified by applications.
Value is the new property value.None.[324:14] static extends: object
Generated metadata helpers for ShortcutsShortcut class surfaces.
properties ()
Returns property metadata for
ShortcutsShortcut.
A list.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.