About all my projects
Gnome::Gtk4::ShortcutsGroup

Gnome::Gtk4::ShortcutsGroup

Description

A Gnome::Gtk4::ShortcutsGroup 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 Gnome::Gtk4::ShortcutsWindow.

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

If you need to add a shortcut programmatically, use .add-shortcut().

Class initialization

new

:native-object

Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object :$native-object! )

Methods

add-shortcut

Adds a shortcut to the shortcuts group.

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

method add-shortcut ( N-Object() $shortcut )
  • $shortcut; the Gnome::Gtk4::ShortcutsShortcut to add.