Page 273 Table of Contents Index Page 275
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E



CHAPTER 27. COMMAND PROCESSING


27.3 Command Menus

Each command table may have a menu consisting of an ordered sequence of command menu
items. The menu specifies a mapping from a menu name (the name displayed in the menu) to
a command menu item. The menu of an application frame's top-level command table may be
presented in a window system specific way, for example, as a menu bar.

Command menu items are stored as a list of the form (type value . options), where type
and value are as in add-menu-item-to-command-table, and options is a list of keyword-value
pairs. The allowable keywords are :documentation, which is used to supply optional pointer
documention for the command menu item, and :text-style, which is used to indicate what
text style should be used for this command menu item when it is displayed in a command menu.

add-menu-item-to-command-table, remove-menu-item-from-command-table, and find-menu-
item
ignore the character case of the command menu item's name when searching through the
command table's menu.

=> add-menu-item-to-command-table command-table string type value &key documentation (af-
ter ':end) keystroke text-style (errorp t)
[Function]
Adds a command menu item to command-table's menu. string is the name of the command menu
item; its character case is ignored. type is either :command, :function, :menu, or :divider.
command-table is a command table designator.

Minor issue: How do we make iconic command menus? Probably another keyword... | SWM

When type is :command, value must be a command (a cons of a command name followed by
a list of the command's arguments), or a command name. (When value is a command name,
it behaves as though a command with no arguments was supplied.) In the case where all
of the command's required arguments are supplied, clicking on an item in the menu invokes
the command immediately. Otherwise, the user will be prompted for the remaining required
arguments.

When type is :function, value must be function having indefinite extent that, when called,
returns a command. The function is called with two arguments, the gesture the user used to
select the item (either a keyboard or button press event) and a "numeric argument".

When type is :menu, this item indicates that a sub-menu will be invoked, and so value must be
another command table or the name of another command table.

When type is :divider, some sort of a dividing line is displayed in the menu at that point. If
string is supplied, it will be drawn as the divider instead of a line. If the look and feel provided by
the underlying window system has no corresponding concept, :divider items may be ignored.
value is ignored.

documentation is a documentation string, which can be used as mouse documentation for the
command menu item.


Page 273 Table of Contents Index Page 275
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E