add_accelerator


Description:

[ Version ( deprecated = true , deprecated_since = "3.14" , since = "3.4" ) ]
public void add_accelerator (string accelerator, string action_name, Variant? parameter)

Warning: add_accelerator is deprecated since 3.14.

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

Note:

Use set_accels_for_action instead

accelerator must be a string that can be parsed by accelerator_parse , e.g. "<Primary>q" or “<Control><Alt>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 MenuModels passed to set_app_menu and set_menubar, which is usually more convenient than calling this function for each accelerator.

Parameters:

this

a Application

accelerator

accelerator string

action_name

the name of the action to activate

parameter

parameter to pass when activating the action, or null if the action does not accept an activation parameter