ShortcutsGroup#

Deprecated since version 4.18: This widget will be removed in GTK 5

class ShortcutsGroup(**properties: Any)#

Superclasses: Box, Widget, InitiallyUnowned, Object

Implemented Interfaces: Accessible, Buildable, ConstraintTarget, Orientable

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 add_shortcut.

Methods#

class ShortcutsGroup
add_shortcut(shortcut: ShortcutsShortcut) None#

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.

Added in version 4.14.

Deprecated since version 4.18: This widget will be removed in GTK 5

Parameters:

shortcut – the GtkShortcutsShortcut to add

Properties#

class ShortcutsGroup
props.accel_size_group: SizeGroup#

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.

Deprecated since version 4.18: This widget will be removed in GTK 5

props.height: int#

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

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

Deprecated since version 4.18: This widget will be removed in GTK 5

props.title: str#

The title for this group of shortcuts.

Deprecated since version 4.18: This widget will be removed in GTK 5

props.title_size_group: SizeGroup#

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.

Deprecated since version 4.18: This widget will be removed in GTK 5

props.view: str#

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

The group will be hidden if the view_name property does not match the view of this group.

Set this to None to make the group always visible.

Deprecated since version 4.18: This widget will be removed in GTK 5