ShortcutAction
Superclasses: Object
Subclasses: ActivateAction
, CallbackAction
, MnemonicAction
, NamedAction
, NothingAction
, SignalAction
- Constructors:
ShortcutAction(**properties)
parse_string(string:str) -> Gtk.ShortcutAction or None
Constructors
- class ShortcutAction
- classmethod parse_string(string: str) ShortcutAction | None
Tries to parse the given string into an action.
On success, the parsed action is returned. When parsing failed,
None
is returned.The accepted strings are:
nothing
, forGtkNothingAction
activate
, forGtkActivateAction
mnemonic-activate
, forGtkMnemonicAction
action(NAME)
, for aGtkNamedAction
for the action namedNAME
signal(NAME)
, for aGtkSignalAction
for the signalNAME
- Parameters:
string – the string to parse
Methods
- class ShortcutAction
- activate(flags: ShortcutActionFlags, widget: Widget, args: Variant | None = None) bool
Activates the action on the
widget
with the givenargs
.Note that some actions ignore the passed in
flags
,widget
orargs
.Activation of an action can fail for various reasons. If the action is not supported by the
widget
, if theargs
don’t match the action or if the activation otherwise had no effect,False
will be returned.- Parameters:
flags – flags to activate with
widget – Target of the activation
args – arguments to pass