Skip to content

Gtk.ShortcutsGroup

class — extends Box, Accessible, Buildable, ConstraintTarget, Orientable

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

A GtkShortcutsGroup represents a group of related keyboard shortcuts or gestures.

The group has a title. It may optionally be associated with a view of the application, which can be used to show only relevant shortcuts depending on the application context.

This widget is only meant to be used with ShortcutsWindow.

The recommended way to construct a GtkShortcutsGroup is with Builder, by using the <child> tag to populate a GtkShortcutsGroup with one or more ShortcutsShortcut instances.

If you need to add a shortcut programmatically, use ShortcutsGroup.add_shortcut.

Methods

add_shortcut

def add_shortcut(self, shortcut: ShortcutsShortcut) -> None

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

Adds a shortcut to the shortcuts group.

This is the programmatic equivalent to using Builder and a <child> tag to add the child. Adding children with other API is not appropriate as GtkShortcutsGroup manages its children internally.

Parameters:

  • shortcut — the GtkShortcutsShortcut to add

Properties

accel_size_group

accel_size_group: SizeGroup  # read/write

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

The size group for the accelerator portion of shortcuts in this group.

This is used internally by GTK, and must not be modified by applications.

height

height: int  # read-only

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

A rough measure for the number of lines in this group.

This is used internally by GTK, and is not useful for applications.

title

title: str  # read/write

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

The title for this group of shortcuts.

title_size_group

title_size_group: SizeGroup  # read/write

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

The size group for the textual portion of shortcuts in this group.

This is used internally by GTK, and must not be modified by applications.

view

view: str  # read/write

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

An optional view that the shortcuts in this group are relevant for.

The group will be hidden if the ShortcutsWindow.view-name property does not match the view of this group.

Set this to None to make the group always visible.