Contents Up Previous Next

Menu

The menu is used only as a component of a menu bar. Create menus, append menu items (strings, separators or further menus), and finally append the menu to the menu bar.

A menu or menu bar string may contain an ampersand, which is taken to mean 'underline the next character and use it as the hotkey'. This gives the user the opportunity to use keystrokes to access menus and items.

menu-create
menu-append
menu-append-separator
menu-break
menu-check
menu-enable


menu-create

long ( menu-create optional string label optional string callback)

Create a menu and returns the menu's ID.

label is unused at present.

callback should be present if creating a popup menu (i.e. not a menubar menu). It will be called with the menu's id when the user selects an item. From within the callback, use panel-item-get-command-event to retrieve the command event and from that, the menu item selection.


menu-append

long ( menu-append long menu-id long item-id
string item-string optional long submenu-id optional string help-string optional long checkable)

Append a string or submenu to the menu, passing the integer ID by which the menu item will be referenced, a string to be displayed, an optional id for a pullright menu, and an optional flag for specifying whether this menu item can be checked.

A help string can be supplied, in which case the string will be shown on the first field of the status line (if any) in the frame containing the menu bar, when the mouse pointer moves over the menu item.


menu-append-separator

long ( menu-append-separator long menu-id)

Append a menu separator.


menu-break

long ( menu-break long menu-id)

Inserts a column break into the menu.


menu-check

long ( menu-check long menu-id long item-id long check)

Check (check = 1 or uncheck check = 0 the given menu item. MS Windows only.


menu-enable

long ( menu-enable long menu-id long item-id long enable)

Enable (enable = 1 or disable enable = 0 the given menu item.