Arbortext Command Language > Hooks > menuloadhook
  
menuloadhook
menuloadhook
 
Function prototype:
hook(window, filename)
Synopsis
Use with:
add_hook(hookname, func[, prepend])
remove_hook(hookname, func)
where hookname is menuloadhook.
This hook is called after a new set of menus is loaded into the menu bar by a menu_load command or by Arbortext Editor when loading a new document. Note, this contrasts with the menuloadbeforehook function which is called before the menu bar has been loaded. Arbortext Editor will not reload menus when switching documents if no menu changes were done. The hook function can be used to add a custom menu to the standard menus using menu_add commands without the need to change the system menu configuration file, editmenu.cf.
* 
You should always place commands that modify menus in edit class windows in a menuloadhook function. Doing so ensures that the menu_add, menu_change and menu_delete commands are executed every time the menus are reloaded, not just when a document is first read. Some user actions force the reloading of menus, such as switching between Full Menus and Short Menus.
Modifying default menus
You can do the following to modify default menus:
For a particular document type, place the commands to modify or load menus in the document type instance command files (instance.acl and instance.js).
For a specific document, place the commands to modify or load menus in the document command files (docname.acl and docname.js) in the directory containing the document docname.
Arguments
window is the window identifier of the window containing the menu bar.
filename is the path name of the menu configuration defining the menus. It is null if the system configuration is not read and the default set of menus were loaded.