Package: gtk

Accessor gtk-menu-accel-path

Lambda List

gtk-menu-accel-path (object)

Syntax

(gtk-menu-accel-path object) => path
(setf (gtk-menu-accel-path object) path)

Arguments

object -- a gtk-menu widget
path -- a string with a valid accelerator path

Details

Accessor of the accel-path slot of the gtk-menu class.

The gtk-menu-accel-path slot access function retrieves the accelerator path for this menu from which accelerator paths for its immediate children, its menu items, can be constructed. The (setf gtk-menu-accel-path) slot access function sets an accelerator path.

The main purpose of this function is to spare the programmer the inconvenience of having to call the gtk-menu-item-accel-path function on each menu item that should support runtime user changable accelerators. Instead, by just calling the gtk-menu-accel-path function on their parent, each menu item of this menu, that contains a label describing its purpose, automatically gets an accel path assigned.

For example, a menu containing menu items "New" and "Exit", will, after
(setf (gtk-menu-accel-path menu) "<Gnumeric-Sheet>/File")  
has been called, assign its items the accel paths: "<Gnumeric-Sheet>/File/New" and "<Gnumeric-Sheet>/File/Exit".

Assigning accel paths to menu items then enables the user to change their accelerators at runtime. More details about accelerator paths and their default setups can be found at the documentation for the gtk-accel-map-add-entry function.
 

See also

2021-11-14