Method

GtkApplicationadd_accelerator

deprecated: 3.14 since: 3.4

Declaration [src]

void
gtk_application_add_accelerator (
  GtkApplication* application,
  const gchar* accelerator,
  const gchar* action_name,
  GVariant* parameter
)

Description [src]

Installs an accelerator that will cause the named action to be activated when the key combination specificed by accelerator is pressed.

accelerator must be a string that can be parsed by gtk_accelerator_parse(), e.g. “q” or “p”.

action_name must be the name of an action as it would be used in the app menu, i.e. actions that have been added to the application are referred to with an “app.” prefix, and window-specific actions with a “win.” prefix.

GtkApplication also extracts accelerators out of “accel” attributes in the GMenuModels passed to gtk_application_set_app_menu() and gtk_application_set_menubar(), which is usually more convenient than calling this function for each accelerator.

Available since: 3.4

Deprecated since: 3.14

Use gtk_application_set_accels_for_action() instead.

Parameters

accelerator

Type: const gchar*

Accelerator string.

The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.
action_name

Type: const gchar*

The name of the action to activate.

The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.
parameter

Type: GVariant

Parameter to pass when activating the action, or NULL if the action does not accept an activation parameter.

The argument can be NULL.
The data is owned by the caller of the method.