GtkShortcut — An object describing a keyboard shortcut
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 () |
GtkShortcutAction * | action | Read / Write |
GVariant * | arguments | Read / Write |
GtkShortcutTrigger * | trigger | Read / Write |
GObject ╰── GtkShortcut
#include <gtk/gtk.h>
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.
GtkShortcut * gtk_shortcut_new (GtkShortcutTrigger *trigger
,GtkShortcutAction *action
);
Creates a new GtkShortcut that is triggered by trigger
and then activates action
.
trigger | The trigger that will trigger the shortcut. | [transfer full][nullable] |
action | The action that will be activated upon triggering. | [transfer full][nullable] |
a new GtkShortcut
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]
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. |
a new GtkShortcut
GtkShortcutTrigger *
gtk_shortcut_get_trigger (GtkShortcut *self
);
Gets the trigger used to trigger self
.
self |
the trigger used.
[transfer none][nullable]
void gtk_shortcut_set_trigger (GtkShortcut *self
,GtkShortcutTrigger *trigger
);
Sets the new trigger for self
to be trigger
.
self | ||
trigger | The new trigger. If the | [transfer full][nullable] |
GtkShortcutAction *
gtk_shortcut_get_action (GtkShortcut *self
);
Gets the action that is activated by this shortcut.
self |
the action.
[transfer none][nullable]
void gtk_shortcut_set_action (GtkShortcut *self
,GtkShortcutAction *action
);
Sets the new action for self
to be action
.
self | ||
action | The new action. If the | [transfer full][nullable] |
GVariant *
gtk_shortcut_get_arguments (GtkShortcut *self
);
Gets the arguments that are passed when activating the shortcut.
self |
the arguments.
[transfer none][nullable]
void gtk_shortcut_set_arguments (GtkShortcut *self
,GVariant *args
);
Sets the arguments to pass when activating the shortcut.
self | ||
args | arguments to pass when activating | [nullable] |
typedef struct _GtkShortcut GtkShortcut;
“action”
property“action” GtkShortcutAction *
The action that gets activated by this shortcut.
Owner: GtkShortcut
Flags: Read / Write
“arguments”
property“arguments” GVariant *
Arguments passed to activation.
Owner: GtkShortcut
Flags: Read / Write
Allowed values: GVariant<*>
Default value: NULL
“trigger”
property“trigger” GtkShortcutTrigger *
The trigger that triggers this shortcut.
Owner: GtkShortcut
Flags: Read / Write
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkShortcut.html