Package: gtk

Class gtk:shortcuts-window

Superclasses

Documented Subclasses

None

Direct Slots

section-name
The section-name property of type :string (Read / Write)
The name of the section to show. This should be the section name of one of the gtk:shortcuts-section objects that are in this shortcuts window.
Default value: "internal-search"
view-name
The view-name property of type :string (Read / Write)
The view name by which to filter the contents. This should correspond to the view property of some of the gtk:shortcuts-group objects that are inside this shortcuts window. Set this to nil to show all groups.
Default value: nil

Details

The gtk:shortcuts-window widget shows brief 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 shortcuts window is with a gtk:builder UI definition, by populating a shortcuts window with one or more gtk:shortcuts-section objects, which contain gtk:shortcuts-group objects that in turn contain objects of the gtk:shortcuts-shortcut class.

Examples

A simple example: 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.

Figure: GEdit shortcuts

An example with multiple views: This example shows a shortcuts window that has been configured to show only the shortcuts relevant to the "stopwatch" view. The .ui file for this example can be found here.

Figure: Clock shortcuts

An example with multiple sections: This example shows a shortcuts window with two sections, "Editor Shortcuts" and "Terminal Shortcuts". The .ui file for this example can be found here.

Figure: Builder shortcuts

Signal Details

The "close" signal
lambda (shortcutswindow)    :action      
shortcutswindow
The gtk:shortcuts-window object.
The signal is a keybinding signal which gets emitted when the user uses a keybinding to close the window. The default binding for this signal is the Escape key.
The "search" signal
lambda (shortcutswindow)    :action      
shortcutswindow
The gtk:shortcuts-window object.
The signal is a keybinding signal which gets emitted when the user uses a keybinding to start a search. The default binding for this signal is the Control-F key.
 

Slot Access Functions

Inherited Slot Access Functions

See also

2024-2-18