Gtk.Widget.prototype.set_accel_path
function set_accel_path(accel_path:String, accel_group:Gtk.AccelGroup):void { // Gjs wrapper for gtk_widget_set_accel_path() }
Given an accelerator group, accel_group, and an accelerator path, accel_path, sets up an accelerator in accel_group so whenever the key binding that is defined for accel_path is pressed, widget will be activated. This removes any accelerators (for any accelerator group) installed by previous calls to Gtk.Widget.prototype.set_accel_path. Associating accelerators with paths allows them to be modified by the user and the modifications to be saved for future use. (See save.)
This function is a low level function that would most likely be used by a menu creation system like Gtk.UIManager. If you use Gtk.UIManager, setting up accelerator paths will be done automatically.
Even when you you aren't using Gtk.UIManager, if you only want to set up accelerators on menu items Gtk.MenuItem.prototype.set_accel_path provides a somewhat more convenient interface.
Note that accel_path string will be stored in a GLib.Quark. Therefore, if you pass a static string, you can save some memory by interning it first with GLib.intern_static_string.
- accel_path
path used to look up the accelerator
- accel_group