The class of menu-item objects. A menu-item is created by calling
specifying the menu-item class or some subclass of it.
Here is a list
of the properties of a menu-item; each can be specified at creation
time by passing the corresponding keyword initarg to
name: a symbol
naming this menu-item, which could be used later with find-named-object to find
the menu-item from its name.
title: a string
to display on the menu for this item. Place a tilde (~) in the string
before a particular character to use that character as a menu access
key, which will appear underlined in the menu. Alternately, the title
may be a
pixmap object (or pixmap handle) in
order to display an image rather than a string in the menu.
arbitrary value to be processed when this menu-item is chosen. When
the menu-item is chosen, this value is passed to handle-menu-selection. Unless an
application overrides the default handle-menu-selection method
(typically not necessary), the default method simply passes the value
to the on-click
function of the menu that this menu-item is on. The default on-click function,
returns the value. This default on-click function is often suitable
for a pop-up-menu, causing this menu-item value to be returned from
the call to pop-up-menu. For a pull-down-menu,
the menu should always be given some other on-click function that performs the
command indicated by this menu-item value (because the application
will not be able to capture the value returned by default-menu-on-click and therefore
the default function effectively does nothing).
symbol or list of symbols denoting the keyboard shortcut for this
menu-item. When this menu-item is on a menu-bar, the user can invoke
the menu-item by typing the event-synonym in the window that the
menu-bar is on. See event-synonym for examples.
arbitrary string to explain what this menu-item does. Built-in
menu-item-highlighted methods will
show this string in the status-bar of the window that owns the menu
when the user highlights this menu-item. (For a pop-up menu, this
window is the one that was passed as the stream argument to the
function pop-up-menu, if any.)
arbitrary symbol to place this menu-item in a group with other
contiguous items on the same menu that specify the same cluster value.
The item will display a dot when selected, and selecting one item in
the cluster deselects the others.
if true, then the event-synonym of the
menu-item may still be used to invoke the item when there is a modal
dialog present. The default is
nil, then the menu-item will be grayed out and
unavailable to the user. The default is true.
true, then the menu-item will display a check mark, or a dot if it is
in a cluster. The default is
Here is a typical menu-item creation form:
:help-string "Shows help on the selected thing."
A menu-item may be added to a menu when the menu is created by calling
added later by calling add-to-menu.
See About how
to get sample code for creating controls in cgide.htm, which explains how to use the
IDE to create such code.
See also the menu
chapter in the IDE User
Copyright (c) 1998-2009, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 8.1. This page was not revised from the 8.0 page.