Gtk.ShortcutLabel
- Subclasses:
None
Class Details
-
class Gtk.ShortcutLabel(**kwargs)
- Bases:
Gtk.Widget
- Abstract:
No
- Structure:
Gtk.ShortcutLabelClass
GtkShortcutLabel
displays a single keyboard shortcut or gesture.
The main use case for GtkShortcutLabel
is inside a [class`Gtk`.ShortcutsWindow].
-
classmethod new(accelerator)[source]
- Parameters:
accelerator (str
) – the initial accelerator
- Returns:
a newly-allocated GtkShortcutLabel
- Return type:
Gtk.Widget
Creates a new GtkShortcutLabel
with accelerator set.
-
get_accelerator()[source]
- Returns:
the current accelerator.
- Return type:
str
or None
Retrieves the current accelerator of self.
-
get_disabled_text()[source]
- Returns:
the current text displayed when no
accelerator is set.
- Return type:
str
or None
Retrieves the text that is displayed when no accelerator is set.
-
set_accelerator(accelerator)[source]
- Parameters:
accelerator (str
) – the new accelerator
Sets the accelerator to be displayed by self.
-
set_disabled_text(disabled_text)[source]
- Parameters:
disabled_text (str
) – the text to be displayed when no accelerator is set
Sets the text to be displayed by self when no accelerator is set.
Property Details
-
Gtk.ShortcutLabel.props.accelerator
- Name:
accelerator
- Type:
str
- Default Value:
None
- Flags:
READABLE
, WRITABLE
The accelerator that self displays.
See [property`Gtk`.ShortcutsShortcut:accelerator]
for the accepted syntax.
-
Gtk.ShortcutLabel.props.disabled_text
- Name:
disabled-text
- Type:
str
- Default Value:
None
- Flags:
READABLE
, WRITABLE
The text that is displayed when no accelerator is set.