Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ShortcutsWindowCloseCallback

[311:7] extends: object

Generated low-level callback wrapper for GIR callback close.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ShortcutsWindowCloseCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: ShortcutsWindow

[48:7] extends: object

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 using the <child> tag to populate a GtkShortcutsWindow with one or more [class@Gtk.ShortcutsSection] objects, which contain one or more [class@Gtk.ShortcutsGroup] instances, which, in turn, contain [class@Gtk.ShortcutsShortcut] instances. If you need to add a section programmatically, use [method@Gtk.ShortcutsWindow.add_section] instead of [method@Gtk.Window.set_child], as the shortcuts window manages its children directly. # A simple example: 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: <source

srcset="clocks-shortcuts-dark.png" media="(prefers-color-scheme: dark)"> 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: <source

srcset="builder-shortcuts-dark.png" media="(prefers-color-scheme: dark)"> 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.

Shortcuts and Gestures The following signals have default keybindings: -

[signal@Gtk.ShortcutsWindow::close] - [signal@Gtk.ShortcutsWindow::search] # CSS nodes GtkShortcutsWindow has a single CSS node with the name window and style class .shortcuts.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • ShortcutsWindow (Handle = null)

    Creates a new ShortcutsWindow by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asWindow ()

    Wraps this handle as Window.

    • @r A Window object.
  • asAccessible ()

    Wraps this handle as Accessible.

    • @r A Accessible object.
  • asBuildable ()

    Wraps this handle as Buildable.

    • @r A Buildable object.
  • asConstraintTarget ()

    Wraps this handle as ConstraintTarget.

    • @r A ConstraintTarget object.
  • asNative ()

    Wraps this handle as Native.

    • @r A Native object.
  • asRoot ()

    Wraps this handle as Root.

    • @r A Root object.
  • asShortcutManager ()

    Wraps this handle as ShortcutManager.

    • @r A ShortcutManager object.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnClose (callback Fn, UserData = null)

    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.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ShortcutsWindow Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnSearch (callback Fn, UserData = null)

    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.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ShortcutsWindow Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setSectionname (string Value)

    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.

    • @p Value is the new property value.
    • @r None.
  • setViewname (string Value)

    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 %NULL to show all groups.

    • @p Value is the new property value.
    • @r None.
  • add_section (object section)

    Adds a section to the shortcuts window. This is the programmatic equivalent to using [class@Gtk.Builder] and a <child> tag to add the child. Using [method@Gtk.Window.set_child] is not appropriate as the shortcuts window manages its children internally.

    • @p section is the GtkShortcutsSection to add.
    • @r None.

class: ShortcutsWindowSearchCallback

[381:7] extends: object

Generated low-level callback wrapper for GIR callback search.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ShortcutsWindowSearchCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: ShortcutsWindowMeta

[451:14] static extends: object

Generated metadata helpers for ShortcutsWindow class surfaces.

Methods

  • properties ()

    Returns property metadata for ShortcutsWindow.

    • @r A list.
  • signals ()

    Returns signal metadata for ShortcutsWindow.

    • @r A list.