Describes a keyboard shortcut.
It contains a description of how to trigger the shortcut via a [classGtk.ShortcutTrigger] and a way to activate the shortcut on a widget via a [classGtk.ShortcutAction].
The actual work is usually done via [classGtk.ShortcutController], which decides if and when to activate a shortcut. Using that controller directly however is rarely necessary as various higher level convenience APIs exist on GtkWidgets that make it easier to use shortcuts in GTK.
GtkShortcut does provide functionality to make it easy for users to work with shortcuts, either by providing informational strings for display purposes or by allowing shortcuts to be configured.
Action_Property : constant Glib.Properties.Property_Object;
Type: Gtk.Shortcut_Action.Gtk_Shortcut_Action The action that gets activated by this shortcut.
function Get_Action
(Self : not null access Gtk_Shortcut_Record)
return Gtk.Shortcut_Action.Gtk_Shortcut_Action
Gets the action that is activated by this shortcut.
the action. Has transfer-ownership='none'.
function Get_Arguments
(Self : not null access Gtk_Shortcut_Record)
return Glib.Variant.Gvariant
Gets the arguments that are passed when activating the shortcut.
the arguments. Has transfer-ownership='none'.
function Get_Trigger
(Self : not null access Gtk_Shortcut_Record)
return Gtk.Shortcut_Trigger.Gtk_Shortcut_Trigger
Gets the trigger used to trigger Self.
the trigger used. Has transfer-ownership='none'.
function Get_Type return Glib.GType
procedure Gtk_New
(Self : out Gtk_Shortcut;
Trigger : access Gtk.Shortcut_Trigger.Gtk_Shortcut_Trigger_Record'Class;
Action : access Gtk.Shortcut_Action.Gtk_Shortcut_Action_Record'Class)
Creates a new GtkShortcut that is triggered by Trigger and then activates Action. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
The trigger that will trigger the shortcut. Has transfer-ownership='full'.
The action that will be activated upon triggering. Has transfer-ownership='full'.
type Gtk_Shortcut is access all Gtk_Shortcut_Record'Class;
function Gtk_Shortcut_New
(Trigger : access Gtk.Shortcut_Trigger.Gtk_Shortcut_Trigger_Record'Class;
Action : access Gtk.Shortcut_Action.Gtk_Shortcut_Action_Record'Class)
return Gtk_Shortcut
Creates a new GtkShortcut that is triggered by Trigger and then activates Action.
The trigger that will trigger the shortcut. Has transfer-ownership='full'.
The action that will be activated upon triggering. Has transfer-ownership='full'.
type Gtk_Shortcut_Record is new GObject_Record with null record;
procedure Initialize
(Self : not null access Gtk_Shortcut_Record'Class;
Trigger : access Gtk.Shortcut_Trigger.Gtk_Shortcut_Trigger_Record'Class;
Action : access Gtk.Shortcut_Action.Gtk_Shortcut_Action_Record'Class)
Creates a new GtkShortcut that is triggered by Trigger and then activates Action. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
The trigger that will trigger the shortcut. Has transfer-ownership='full'.
The action that will be activated upon triggering. Has transfer-ownership='full'.
procedure Set_Action
(Self : not null access Gtk_Shortcut_Record;
Action : access Gtk.Shortcut_Action.Gtk_Shortcut_Action_Record'Class)
Sets the new action for Self to be Action.
The new action. If the Action is null, the nothing action will be used. Has transfer-ownership='full'.
procedure Set_Arguments
(Self : not null access Gtk_Shortcut_Record;
Args : Glib.Variant.Gvariant)
Sets the arguments to pass when activating the shortcut.
arguments to pass when activating Self
procedure Set_Trigger
(Self : not null access Gtk_Shortcut_Record;
Trigger : access Gtk.Shortcut_Trigger.Gtk_Shortcut_Trigger_Record'Class)
Sets the new trigger for Self to be Trigger.
The new trigger. If the Trigger is null, the never trigger will be used. Has transfer-ownership='full'.
Trigger_Property : constant Glib.Properties.Property_Object;
Type: Gtk.Shortcut_Trigger.Gtk_Shortcut_Trigger The trigger that triggers this shortcut.