gtk.shortcuts_window

Module for ShortcutsWindow class

Types 3

A gtk.shortcuts_window.ShortcutsWindow shows information about the keyboard shortcuts and gestures of an application.

The shortcuts can be grouped, and you can have multiple sections in this window, corresponding to the major modes of your application.

Additionally, the shortcuts can be filtered by the current view, to avoid showing information that is not relevant in the current application context.

The recommended way to construct a gtk.shortcuts_window.ShortcutsWindow is with gtk.builder.Builder, by using the <child> tag to populate a gtk.shortcuts_window.ShortcutsWindow with one or more gtk.shortcuts_section.ShortcutsSection objects, which contain one or more gtk.shortcuts_group.ShortcutsGroup instances, which, in turn, contain gtk.shortcuts_shortcut.ShortcutsShortcut instances.

If you need to add a section programmatically, use gtk.shortcuts_window.ShortcutsWindow.addSection instead of gtk.window.Window.setChild, as the shortcuts window manages its children directly.

A simple example:

![](gedit-shortcuts.png)

This example has as single section. As you can see, the shortcut groups are arranged in columns, and spread across several pages if there are too many to find on a single page.

The .ui file for this example can be found here.

An example with multiple views:

![](clocks-shortcuts.png)

This example shows a gtk.shortcuts_window.ShortcutsWindow that has been configured to show only the shortcuts relevant to the "stopwatch" view.

The .ui file for this example can be found here.

An example with multiple sections:

![](builder-shortcuts.png)

This example shows a gtk.shortcuts_window.ShortcutsWindow with two sections, "Editor Shortcuts" and "Terminal Shortcuts".

The .ui file for this example can be found here.

CSS nodes

gtk.shortcuts_window.ShortcutsWindow has a single CSS node with the name window and style class .shortcuts.

Methods
GType _gType() @property
ShortcutsWindow self()Returns `this`, for use in `with` statements.
ShortcutsWindowGidBuilder builder()Get builder for [gtk.shortcuts_window.ShortcutsWindow] Returns: New builder object
string sectionName() @propertyGet `sectionName` property. Returns: The name of the section to show.
void sectionName(string propval) @propertySet `sectionName` property. Params: propval = The name of the section to show.
string viewName() @propertyGet `viewName` property. Returns: The view name by which to filter the contents.
void viewName(string propval) @propertySet `viewName` property. Params: propval = The view name by which to filter the contents.
void addSection(gtk.shortcuts_section.ShortcutsSection section)Adds a section to the shortcuts window.
gulong connectClose(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.shortcuts_window.ShortcutsWindow))) && Parameters!T.length < 2)Connect to `Close` signal.
gulong connectSearch(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.shortcuts_window.ShortcutsWindow))) && Parameters!T.length < 2)Connect to `Search` signal.
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder implementation template for gtk.shortcuts_window.ShortcutsWindow

Methods
T sectionName(string propval)Set `sectionName` property. Params: propval = The name of the section to show.
T viewName(string propval)Set `viewName` property. Params: propval = The view name by which to filter the contents.