Top |
Functions
GtkShortcut * | gtk_shortcut_new () |
GtkShortcut * | gtk_shortcut_new_with_arguments () |
GtkShortcutTrigger * | gtk_shortcut_get_trigger () |
void | gtk_shortcut_set_trigger () |
GtkShortcutAction * | gtk_shortcut_get_action () |
void | gtk_shortcut_set_action () |
GVariant * | gtk_shortcut_get_arguments () |
void | gtk_shortcut_set_arguments () |
Properties
GtkShortcutAction * | action | Read / Write |
GVariant * | arguments | Read / Write |
GtkShortcutTrigger * | trigger | Read / Write |
Description
GtkShortcut is the low level object used for managing keyboard shortcuts.
It contains a description of how to trigger the shortcut via a GtkShortcutTrigger and a way to activate the shortcut on a widget via GtkShortcutAction.
The actual work is usually done via GtkShortcutController, 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.
Functions
gtk_shortcut_new ()
GtkShortcut * gtk_shortcut_new (GtkShortcutTrigger *trigger
,GtkShortcutAction *action
);
Creates a new GtkShortcut that is triggered by trigger
and then activates
action
.
gtk_shortcut_new_with_arguments ()
GtkShortcut * gtk_shortcut_new_with_arguments (GtkShortcutTrigger *trigger
,GtkShortcutAction *action
,const char *format_string
,...
);
Creates a new GtkShortcut that is triggered by trigger
and then activates
action
with arguments given by format_string
.
[skip]
Parameters
trigger |
The trigger that will trigger the shortcut. |
[transfer full][nullable] |
action |
The action that will be activated upon triggering. |
[transfer full][nullable] |
format_string |
GVariant format string for arguments or |
[allow-none] |
... |
arguments, as given by format string. |
gtk_shortcut_get_trigger ()
GtkShortcutTrigger *
gtk_shortcut_get_trigger (GtkShortcut *self
);
Gets the trigger used to trigger self
.
gtk_shortcut_set_trigger ()
void gtk_shortcut_set_trigger (GtkShortcut *self
,GtkShortcutTrigger *trigger
);
Sets the new trigger for self
to be trigger
.
gtk_shortcut_get_action ()
GtkShortcutAction *
gtk_shortcut_get_action (GtkShortcut *self
);
Gets the action that is activated by this shortcut.
gtk_shortcut_set_action ()
void gtk_shortcut_set_action (GtkShortcut *self
,GtkShortcutAction *action
);
Sets the new action for self
to be action
.
gtk_shortcut_get_arguments ()
GVariant *
gtk_shortcut_get_arguments (GtkShortcut *self
);
Gets the arguments that are passed when activating the shortcut.
gtk_shortcut_set_arguments ()
void gtk_shortcut_set_arguments (GtkShortcut *self
,GVariant *args
);
Sets the arguments to pass when activating the shortcut.
Property Details
The “action”
property
“action” GtkShortcutAction *
The action that gets activated by this shortcut.
Owner: GtkShortcut
Flags: Read / Write
The “arguments”
property
“arguments” GVariant *
Arguments passed to activation.
Owner: GtkShortcut
Flags: Read / Write
Allowed values: GVariant<*>
Default value: NULL
The “trigger”
property
“trigger” GtkShortcutTrigger *
The trigger that triggers this shortcut.
Owner: GtkShortcut
Flags: Read / Write