Next: , Previous: , Up: Menus   [Contents][Index]


27.3 Menubar

Variable: current-menubar

This variable holds the description of the current menubar. This may be buffer-local. When the menubar is changed, the function set-menubar-dirty-flag has to be called in order for the menubar to be updated on the screen.

Constant: default-menubar

This variable holds the menubar description of the menubar that is visible at startup. This is the value that current-menubar has at startup.

Function: set-menubar-dirty-flag

This function tells SXEmacs that the menubar widget has to be updated. Changes to the menubar will generally not be visible until this function is called.

The following convenience functions are provided for setting the menubar. They are equivalent to doing the appropriate action to change current-menubar, and then calling set-menubar-dirty-flag. Note that these functions copy their argument using copy-sequence.

Function: set-menubar menubar

This function sets the default menubar to be menubar (see Menu Format). This is the menubar that will be visible in buffers that have not defined their own, buffer-local menubar.

Function: set-buffer-menubar menubar

This function sets the buffer-local menubar to be menubar. This does not change the menubar in any buffers other than the current one.

Miscellaneous:

Variable: menubar-show-keybindings

If true, the menubar will display keyboard equivalents. If false, only the command names will be displayed.

Variable: activate-menubar-hook

Function or functions called before a menubar menu is pulled down. These functions are called with no arguments, and should interrogate and modify the value of current-menubar as desired.

The functions on this hook are invoked after the mouse goes down, but before the menu is mapped, and may be used to activate, deactivate, add, or delete items from the menus. However, using a filter (with the :filter keyword in a menu description) is generally a more efficient way of accomplishing the same thing, because the filter is invoked only when the actual menu goes down. With a complex menu, there can be a quite noticeable and sometimes aggravating delay if all menu modification is implemented using the activate-menubar-hook. See above.

These functions may return the symbol t to assert that they have made no changes to the menubar. If any other value is returned, the menubar is recomputed. If t is returned but the menubar has been changed, then the changes may not show up right away. Returning nil when the menubar has not changed is not so bad; more computation will be done, but redisplay of the menubar will still be performed optimally.

Variable: menu-no-selection-hook

Function or functions to call when a menu or dialog box is dismissed without a selection having been made.


Next: , Previous: , Up: Menus   [Contents][Index]