Gtk.Shortcut¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.Shortcut(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A
GtkShortcut
describes a keyboard shortcut.It contains a description of how to trigger the shortcut via a [class`Gtk`.ShortcutTrigger] and a way to activate the shortcut on a widget via a [class`Gtk`.ShortcutAction].
The actual work is usually done via [class`Gtk`.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 ``GtkWidget``s 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.- classmethod new(trigger, action)[source]¶
- Parameters:
trigger (
Gtk.ShortcutTrigger
orNone
) – The trigger that will trigger the shortcutaction (
Gtk.ShortcutAction
orNone
) – The action that will be activated upon triggering
- Returns:
a new
GtkShortcut
- Return type:
Creates a new
GtkShortcut
that is triggered by trigger and then activates action.
- get_action()[source]¶
- Returns:
the action
- Return type:
Gets the action that is activated by this shortcut.
- get_arguments()[source]¶
- Returns:
the arguments
- Return type:
GLib.Variant
orNone
Gets the arguments that are passed when activating the shortcut.
- get_trigger()[source]¶
- Returns:
the trigger used
- Return type:
Gets the trigger used to trigger self.
- set_action(action)[source]¶
- Parameters:
action (
Gtk.ShortcutAction
orNone
) – The new action. If the action isNone
, the nothing action will be used.
Sets the new action for self to be action.
- set_arguments(args)[source]¶
- Parameters:
args (
GLib.Variant
orNone
) – arguments to pass when activating self
Sets the arguments to pass when activating the shortcut.
- set_trigger(trigger)[source]¶
- Parameters:
trigger (
Gtk.ShortcutTrigger
orNone
) – The new trigger. If the trigger isNone
, the never trigger will be used.
Sets the new trigger for self to be trigger.
Property Details¶
- Gtk.Shortcut.props.action¶
- Name:
action
- Type:
- Default Value:
- Flags:
The action that gets activated by this shortcut.
- Gtk.Shortcut.props.arguments¶
- Name:
arguments
- Type:
- Default Value:
- Flags:
Arguments passed to activation.
- Gtk.Shortcut.props.trigger¶
- Name:
trigger
- Type:
- Default Value:
- Flags:
The trigger that triggers this shortcut.