Gtk.ShortcutLabel

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.ShortcutLabel Gtk.ShortcutLabel Gtk.Widget->Gtk.ShortcutLabel

Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new (accelerator)

get_accelerator ()

get_disabled_text ()

set_accelerator (accelerator)

set_disabled_text (disabled_text)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

accelerator

str

r/w

disabled-text

str

r/w

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

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.