Class: Gtk::ShortcutAction

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ Gtk::ShortcutAction

Tries to parse the given string into an action.

On success, the parsed action is returned. When parsing failed, nil is returned.

The accepted strings are:

  • nothing, for GtkNothingAction
  • activate, for GtkActivateAction
  • mnemonic-activate, for GtkMnemonicAction
  • action(NAME), for a GtkNamedAction for the action named NAME
  • signal(NAME), for a GtkSignalAction for the signal NAME

Parameters:

  • string (String)

    the string to parse

Instance Method Details

#activate(flags, widget, args) ⇒ Boolean

Activates the action on the widget with the given args.

Note that some actions ignore the passed in flags, widget or args.

Activation of an action can fail for various reasons. If the action is not supported by the widget, if the args don't match the action or if the activation otherwise had no effect, false will be returned.

Parameters:

Returns:

  • (Boolean)

    true if this action was activated successfully

Prints the given action into a string for the developer.

This is meant for debugging and logging.

The form of the representation may change at any time and is not guaranteed to stay identical.

Parameters:

  • string (GLib::String)

    a GString to print into

Returns:

  • (nil)

#to_stringString

Prints the given action into a human-readable string.

This is a small wrapper around [methodGtk.ShortcutAction.print] to help when debugging.

Returns:

  • (String)

    a new string