:right-sidebar: True ShortcutsGroup =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: ShortcutsGroup(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Box`, :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget`, :class:`~gi.repository.Gtk.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 :obj:`~gi.repository.Gtk.ShortcutsWindow`. The recommended way to construct a ``GtkShortcutsGroup`` is with :obj:`~gi.repository.Gtk.Builder`, by using the ```` tag to populate a ``GtkShortcutsGroup`` with one or more :obj:`~gi.repository.Gtk.ShortcutsShortcut` instances. If you need to add a shortcut programmatically, use :obj:`~gi.repository.Gtk.ShortcutsGroup.add_shortcut`. Methods ------- .. rst-class:: interim-class .. class:: ShortcutsGroup :no-index: .. method:: add_shortcut(shortcut: ~gi.repository.Gtk.ShortcutsShortcut) -> None Adds a shortcut to the shortcuts group. This is the programmatic equivalent to using :obj:`~gi.repository.Gtk.Builder` and a ```` tag to add the child. Adding children with other API is not appropriate as ``GtkShortcutsGroup`` manages its children internally. .. versionadded:: 4.14 :param shortcut: the ``GtkShortcutsShortcut`` to add Properties ---------- .. rst-class:: interim-class .. class:: ShortcutsGroup :no-index: .. attribute:: props.accel_size_group :type: ~gi.repository.Gtk.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. .. attribute:: props.height :type: int A rough measure for the number of lines in this group. This is used internally by GTK, and is not useful for applications. .. attribute:: props.title :type: str The title for this group of shortcuts. .. attribute:: props.title_size_group :type: ~gi.repository.Gtk.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. .. attribute:: props.view :type: str An optional view that the shortcuts in this group are relevant for. The group will be hidden if the :obj:`~gi.repository.Gtk.ShortcutsWindow.props.view_name` property does not match the view of this group. Set this to :const:`None` to make the group always visible.