Package: gtk

Function gtk-application-add-accelerator

Lambda List

gtk-application-add-accelerator (application accel name &optional parameter)

Arguments

application -- a gtk-application instance
accel -- a string representing an accelerator
name -- a string with the name of the action to activate
parameter -- an optional g-variant parameter to pass when activating the action, or nil, the default, if the action does not accept an activation parameter

Details

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

The accel argument must be a string that can be parsed by the gtk-accelerator-parse function, e.g. "<Primary>q" or "<Control><Alt>p".

The name argument must be the name of an action as it would be used in the application 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.

The gtk-application instance also extracts accelerators out of 'accel' attributes in the g-menu-model objects passed to the gtk-application-app-menu and gtk-application-menubar functions, which is usually more convenient than calling this function for each accelerator.

Warning

The gtk-application-add-accelerator function has been deprecated since version 3.14 and should not be used in newly written code. Use the gtk-application-accels-for-action function instead.
 

See also

2021-9-8