Gtk.ShortcutsWindow

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Bin Gtk.Bin Gtk.Window Gtk.Window Gtk.Bin->Gtk.Window Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.ShortcutsWindow Gtk.ShortcutsWindow Gtk.Widget->Gtk.Container Gtk.Window->Gtk.ShortcutsWindow

Subclasses

None

Methods

Inherited

Gtk.Window (119), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)

Structs

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

Virtual Methods

Inherited

Gtk.Window (5), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

do_close ()

do_search ()

Properties

Inherited

Gtk.Window (33), Gtk.Container (3), Gtk.Widget (39)

Name

Type

Flags

Short Description

section-name

str

r/w

Section Name

view-name

str

r/w

View Name

Style Properties

Inherited

Gtk.Window (2), Gtk.Widget (17)

Signals

Inherited

Gtk.Window (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Short Description

close

The ::close signal is a keybinding signal which gets emitted when the user uses a keybinding to close the window.

search

The ::search signal is a keybinding signal which gets emitted when the user uses a keybinding to start a search.

Fields

Inherited

Gtk.Window (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Type

Access

Description

window

Gtk.Window

r

Class Details

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

Gtk.Window

Abstract

No

Structure

Gtk.ShortcutsWindowClass

A Gtk.ShortcutsWindow 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 Gtk.ShortcutsWindow is with Gtk.Builder, by populating a Gtk.ShortcutsWindow with one or more Gtk.ShortcutsSection objects, which contain Gtk.ShortcutsGroups that in turn contain objects of class Gtk.ShortcutsShortcut.

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 Gtk.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:

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

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

do_close() virtual

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

The ::close 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.

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

search

Flags

RUN_LAST, ACTION

Parameters

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

The ::search 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 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 Gtk.ShortcutsSection 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 Gtk.ShortcutsGroup :view property of some of the Gtk.ShortcutsGroup objects that are inside this shortcuts window.

Set this to None to show all groups.