GtkShortcutAction

GtkShortcutAction — Tracking if shortcuts should be activated

Functions

Types and Values

  GtkShortcutAction

Object Hierarchy

    GObject
    ╰── GtkShortcutAction

Includes

#include <gtk/gtk.h>

Description

GtkShortcutAction is the object used to describe what a GtkShortcut should do when triggered. To activate a GtkShortcutAction manually, gtk_shortcut_action_activate() can be called.

GtkShortcutActions contain functions that allow easy presentation to end users as well as being printed for debugging.

All GtkShortcutActions are immutable, you can only specify their properties during construction. If you want to change a action, you have to replace it with a new one. If you need to pass arguments to an action, these are specified by the higher-level GtkShortcut object.

GTK provides various actions:

  • GtkMnemonicAction: a shortcut action that calls gtk_widget_mnemonic_activate()

  • GtkCallbackAction: a shortcut action that invokes a given callback

  • GtkSignalAction: a shortcut action that emits a given signal

  • GtkActivateAction: a shortcut action that calls gtk_widget_activate()

  • GtkNamedAction: a shortcut action that calls gtk_widget_activate_action()

  • GtkGActionAction: a shortcut action that activates a given GAction

  • GtkNothingAction: a shortcut action that does nothing

Functions

gtk_shortcut_action_print ()

void
gtk_shortcut_action_print (GtkShortcutAction *self,
                           GString *string);

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

self

a GtkShortcutAction

 

string

a GString to print into

 

gtk_shortcut_action_activate ()

gboolean
gtk_shortcut_action_activate (GtkShortcutAction *self,
                              GtkShortcutActionFlags flags,
                              GtkWidget *widget,
                              GVariant *args);

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

self

a GtkShortcutAction

 

flags

flags to activate with

 

widget

Target of the activation

 

args

arguments to pass.

[allow-none]

Returns

TRUE if this action was activated successfully


gtk_signal_action_get_signal_name ()

const char *
gtk_signal_action_get_signal_name (GtkSignalAction *self);

Returns the name of the signal that will be emitted.

Parameters

self

a signal action

 

Returns

the name of the signal to emit.

[transfer none]

See Also

GtkShortcut