Skip to content

Gtk.ShortcutLabel

class — extends Widget, Accessible, Buildable, ConstraintTarget

:::warning Deprecated since 4.18 This API is deprecated. :::

GtkShortcutLabel displays a single keyboard shortcut or gesture.

The main use case for GtkShortcutLabel is inside a ShortcutsWindow.

Constructors

new

@classmethod
def new(cls, accelerator: str) -> Widget

:::warning Deprecated since 4.18 This API is deprecated. :::

Creates a new GtkShortcutLabel with accelerator set.

Parameters:

  • accelerator — the initial accelerator

Methods

get_accelerator

def get_accelerator(self) -> str | None

:::warning Deprecated since 4.18 This API is deprecated. :::

Retrieves the current accelerator of self.

get_disabled_text

def get_disabled_text(self) -> str | None

:::warning Deprecated since 4.18 This API is deprecated. :::

Retrieves the text that is displayed when no accelerator is set.

set_accelerator

def set_accelerator(self, accelerator: str) -> None

:::warning Deprecated since 4.18 This API is deprecated. :::

Sets the accelerator to be displayed by self.

Parameters:

  • accelerator — the new accelerator

set_disabled_text

def set_disabled_text(self, disabled_text: str) -> None

:::warning Deprecated since 4.18 This API is deprecated. :::

Sets the text to be displayed by self when no accelerator is set.

Parameters:

  • disabled_text — the text to be displayed when no accelerator is set

Properties

accelerator

accelerator: str  # read/write

:::warning Deprecated since 4.18 This API is deprecated. :::

The accelerator that self displays.

See ShortcutsShortcut.accelerator for the accepted syntax.

disabled_text

disabled_text: str  # read/write

:::warning Deprecated since 4.18 This API is deprecated. :::

The text that is displayed when no accelerator is set.