CtkShortcutsWindow

CtkShortcutsWindow — Toplevel which shows help for shortcuts

Properties

char * section-name Read / Write
char * view-name Read / Write

Signals

void close Action
void search Action

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── CtkWidget
            ╰── CtkContainer
                ╰── CtkBin
                    ╰── CtkWindow
                        ╰── CtkShortcutsWindow

Implemented Interfaces

CtkShortcutsWindow implements AtkImplementorIface and CtkBuildable.

Includes

#include <ctk/ctk.h>

Description

A CtkShortcutsWindow 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 CtkShortcutsWindow is with CtkBuilder, by populating a CtkShortcutsWindow with one or more CtkShortcutsSection objects, which contain CtkShortcutsGroups that in turn contain objects of class CtkShortcutsShortcut.

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 CtkShortcutsWindow 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 CtkShortcutsWindow with two sections, "Editor Shortcuts" and "Terminal Shortcuts".

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

Functions

Types and Values

struct CtkShortcutsWindow

struct CtkShortcutsWindow;

Property Details

The “section-name” property

  “section-name”             char *

The name of the section to show.

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

Owner: CtkShortcutsWindow

Flags: Read / Write

Default value: "internal-search"


The “view-name” property

  “view-name”                char *

The view name by which to filter the contents.

This should correspond to the “view” property of some of the CtkShortcutsGroup objects that are inside this shortcuts window.

Set this to NULL to show all groups.

Owner: CtkShortcutsWindow

Flags: Read / Write

Default value: NULL

Signal Details

The “close” signal

void
user_function (CtkShortcutsWindow *ctkshortcutswindow,
               gpointer            user_data)

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.

Parameters

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “search” signal

void
user_function (CtkShortcutsWindow *ctkshortcutswindow,
               gpointer            user_data)

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.

Parameters

user_data

user data set when the signal handler was connected.

 

Flags: Action