Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Shortcut

[21:7] extends: object

Describes a keyboard shortcut. It contains a description of how to trigger the shortcut via a [class@Gtk.ShortcutTrigger] and a way to activate the shortcut on a widget via a [class@Gtk.ShortcutAction]. The actual work is usually done via [class@Gtk.ShortcutController], which decides if and when to activate a shortcut. Using that controller directly however is rarely necessary as various higher level convenience APIs exist on GtkWidgets that make it easier to use shortcuts in GTK. GtkShortcut does provide functionality to make it easy for users to work with shortcuts, either by providing informational strings for display purposes or by allowing shortcuts to be configured.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Shortcut (trigger = null, action = null)

    Creates a new GtkShortcut that is triggered by @trigger and then activates @action.

    • @p trigger is The trigger that will trigger the shortcut.
    • @p action is The action that will be activated upon triggering.
  • 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.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object object.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setAction (object Value)

    The action that gets activated by this shortcut.

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

    Arguments passed to activation.

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

    The trigger that triggers this shortcut.

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

    Gets the action that is activated by this shortcut.

  • get_arguments ()

    Gets the arguments that are passed when activating the shortcut.

  • get_trigger ()

    Gets the trigger used to trigger @self.

  • set_action (object action)

    Sets the new action for @self to be @action.

    • @p action is The new action. If the @action is %NULL, the nothing action will be used..
    • @r None.
  • set_arguments (object args)

    Sets the arguments to pass when activating the shortcut.

    • @p args is arguments to pass when activating @self.
    • @r None.
  • set_trigger (object trigger)

    Sets the new trigger for @self to be @trigger.

    • @p trigger is The new trigger. If the @trigger is %NULL, the never trigger will be used..
    • @r None.

class: ShortcutMeta

[236:14] static extends: object

Generated metadata helpers for Shortcut class surfaces.

Methods

  • properties ()

    Returns property metadata for Shortcut.

    • @r A list.