Basics
Guides
API Reference
Basics
Guides
API Reference
[27:7] extends: object
Encodes an action that can be triggered by a keyboard shortcut.
GtkShortcutActions contain functions that allow easy presentation to end
users as well as being printed for debugging. All GtkShortcutActions are
immutable, you can only specify their properties during construction. If you
want to change a action, you have to replace it with a new one. If you need
to pass arguments to an action, these are specified by the higher-level
GtkShortcut object. To activate a GtkShortcutAction manually,
[method@Gtk.ShortcutAction.activate] can be called. GTK provides various
actions: - [class@Gtk.MnemonicAction]: a shortcut action that calls
gtk_widget_mnemonic_activate() - [class@Gtk.CallbackAction]: a shortcut
action that invokes a given callback - [class@Gtk.SignalAction]: a shortcut
action that emits a given signal - [class@Gtk.ActivateAction]: a shortcut
action that calls gtk_widget_activate() - [class@Gtk.NamedAction]: a shortcut
action that calls gtk_widget_activate_action() - [class@Gtk.NothingAction]: a
shortcut action that does nothing
ShortcutAction (argString = null)
Tries to parse the given string into an action. On success, the parsed action is returned. When parsing failed, %NULL is returned. The accepted strings are: -
nothing, forGtkNothingAction-activate, forGtkActivateAction-mnemonic-activate, forGtkMnemonicAction-action(NAME), for aGtkNamedActionfor the action namedNAME-signal(NAME), for aGtkSignalActionfor the signalNAME
argString is the string to parse.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.asObject ()
Wraps this handle as
Object.
A Object object.activate (string flags, object widget, object args)
Activates the action on the @widget with the given @args. Note that some actions ignore the passed in @flags, @widget or @args. Activation of an action can fail for various reasons. If the action is not supported by the @widget, if the @args don't match the action or if the activation otherwise had no effect, %FALSE will be returned.
flags is flags to activate with.widget is Target of the activation.args is arguments to pass.print (arg1String)
Prints the given action into a string for the developer. This is meant for debugging and logging. The form of the representation may change at any time and is not guaranteed to stay identical.
string is a GString to print into.None.to_string ()
Prints the given action into a human-readable string. This is a small wrapper around [method@Gtk.ShortcutAction.print] to help when debugging.

Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.