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, [methodGtk.ShortcutAction.activate] can be called.
GTK provides various actions:
[classGtk.MnemonicAction]: a shortcut action that calls
Gtk.Widget.Mnemonic_Activate - [classGtk.CallbackAction]: a shortcut action that invokes a given callback - [classGtk.SignalAction]: a shortcut action that emits a given signal - [classGtk.ActivateAction]: a shortcut action that calls Gtk.Widget.Activate - [classGtk.NamedAction]: a shortcut action that calls gtk_widget_activate_action - [classGtk.NothingAction]: a shortcut action that does nothing
function Activate
(Self : not null access Gtk_Shortcut_Action_Record;
Flags : Gtk_Shortcut_Action_Flags;
Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class;
Args : Glib.Variant.Gvariant) return Boolean
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 to activate with
Target of the activation
arguments to pass
True if this action was activated successfully
function Get_Type return Glib.GType
procedure Gtk_New (Self : out Gtk_Shortcut_Action; String : UTF8_String)
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, for GtkNothingAction - activate, for
GtkActivateAction - mnemonic-activate, for GtkMnemonicAction - action(NAME), for a GtkNamedAction for the action named NAME - signal(NAME), for a GtkSignalAction for the signal NAME Initialize does nothing if the object was already created with another call to Initialize* or G_New.
the string to parse
type Gtk_Shortcut_Action is access all Gtk_Shortcut_Action_Record'Class;
type Gtk_Shortcut_Action_Flags is mod 2 ** Integer'Size;
Flags that can be passed to action activation.
More flags may be added in the future.
package Gtk_Shortcut_Action_Flags_Properties is
new Generic_Internal_Flags_Property (Gtk_Shortcut_Action_Flags);
function Gtk_Shortcut_Action_Parse_String
(String : UTF8_String) return Gtk_Shortcut_Action
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, for GtkNothingAction - activate, for
GtkActivateAction - mnemonic-activate, for GtkMnemonicAction - action(NAME), for a GtkNamedAction for the action named NAME - signal(NAME), for a GtkSignalAction for the signal NAME
the string to parse
type Gtk_Shortcut_Action_Record is new GObject_Record with null record;
procedure Initialize
(Self : not null access Gtk_Shortcut_Action_Record'Class;
String : UTF8_String)
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, for GtkNothingAction - activate, for
GtkActivateAction - mnemonic-activate, for GtkMnemonicAction - action(NAME), for a GtkNamedAction for the action named NAME - signal(NAME), for a GtkSignalAction for the signal NAME Initialize does nothing if the object was already created with another call to Initialize* or G_New.
the string to parse
procedure Print
(Self : not null access Gtk_Shortcut_Action_Record;
String : Glib.String.Gstring)
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.
a GString to print into
type Property_Gtk_Shortcut_Action_Flags is new Gtk_Shortcut_Action_Flags_Properties.Property;
Shortcut_Action_Exclusive : constant Gtk_Shortcut_Action_Flags := 1;
function To_String
(Self : not null access Gtk_Shortcut_Action_Record) return UTF8_String
Prints the given action into a human-readable string. This is a small wrapper around [methodGtk.ShortcutAction.print] to help when debugging.
a new string