Gtk.ShortcutsWindow

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget Gtk.Native Gtk.Native GObject.GInterface->Gtk.Native Gtk.Root Gtk.Root GObject.GInterface->Gtk.Root Gtk.ShortcutManager Gtk.ShortcutManager GObject.GInterface->Gtk.ShortcutManager GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Window Gtk.Window Gtk.Native->Gtk.Window Gtk.Root->Gtk.Window Gtk.ShortcutManager->Gtk.Window Gtk.ShortcutsWindow Gtk.ShortcutsWindow Gtk.Widget->Gtk.Window Gtk.Window->Gtk.ShortcutsWindow

Example

../_images/ShortcutsWindow.png
Subclasses:

None

Methods

Inherited:

Gtk.Window (62), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Native (6), Gtk.Root (3)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

Virtual Methods

Inherited:

Gtk.Window (5), Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9), Gtk.ShortcutManager (2)

Properties

Inherited:

Gtk.Window (25), Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

section-name

str

r/w

view-name

str

r/w

Signals

Inherited:

Gtk.Window (5), Gtk.Widget (13), GObject.Object (1)

Name

Short Description

close

Emitted when the user uses a keybinding to close the window.

search

Emitted when the user uses a keybinding to start a search.

Fields

Inherited:

Gtk.Window (5), Gtk.Widget (13), GObject.Object (1)

Class Details

class Gtk.ShortcutsWindow(*args, **kwargs)
Bases:

Gtk.Window

Abstract:

No

A GtkShortcutsWindow 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 GtkShortcutsWindow is with [class`Gtk`.Builder], by populating a GtkShortcutsWindow with one or more GtkShortcutsSection objects, which contain GtkShortcutsGroups that in turn contain objects of class GtkShortcutsShortcut.

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.

An example with multiple views:

This example shows a GtkShortcutsWindow 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:

This example shows a GtkShortcutsWindow with two sections, “Editor Shortcuts” and “Terminal Shortcuts”.

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

CSS nodes

GtkShortcutsWindow has a single CSS node with the name window and style class .shortcuts.

Signal Details

Gtk.ShortcutsWindow.signals.close(shortcuts_window)
Signal Name:

close

Flags:

RUN_LAST, ACTION

Parameters:

shortcuts_window (Gtk.ShortcutsWindow) – The object which received the signal

Emitted when the user uses a keybinding to close the window.

This is a keybinding signal.

The default binding for this signal is the Escape key.

Gtk.ShortcutsWindow.signals.search(shortcuts_window)
Signal Name:

search

Flags:

RUN_LAST, ACTION

Parameters:

shortcuts_window (Gtk.ShortcutsWindow) – The object which received the signal

Emitted when the user uses a keybinding to start a search.

This is a keybinding signal.

The default binding for this signal is Control-F.

Property Details

Gtk.ShortcutsWindow.props.section_name
Name:

section-name

Type:

str

Default Value:

'internal-search'

Flags:

READABLE, WRITABLE

The name of the section to show.

This should be the section-name of one of the GtkShortcutsSection objects that are in this shortcuts window.

Gtk.ShortcutsWindow.props.view_name
Name:

view-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The view name by which to filter the contents.

This should correspond to the [property`Gtk`.ShortcutsGroup:view] property of some of the [class`Gtk`.ShortcutsGroup] objects that are inside this shortcuts window.

Set this to None to show all groups.