1 CAPI Reference Entries

menu-item

Class

Summary

A menu item is an individual item in a menu or menu component, and instances ofmenu-item are created automatically bydefine-interface.

Superclasses

item
titled-menu-object

Description

The text displayed in the menu item is the contents of the text slot, or the contents of the title slot, otherwise it is the result of applying the print function to the data.

Callbacks are made in response to a user gesture on a menu item. The callback type, function and data function (see callbacks) are found by looking for a non-nil value, first in the menu item, then the menu component (if any) and finally the menu. This allows a whole menu to have, for example,callback-type:data without having to specify this in each item. Some items could override this by having theircallback-type slot non-nil if needed.

Example

(capi:contain (make-instance 'capi:menu-item
                             :text "Press Me"))

(capi:contain (make-instance 'capi:menu-item :data :red :print-function 'string-capitalize))

(capi:contain (make-instance 'capi:menu-item :data :red :print-function 'string-capitalize :callback #'(lambda (data interface) (capi:display-message "Pressed ~S" data))))

Example File

capi/elements/menus.lisp

See Also

menu
menu-component
choice


CAPI Reference Manual, Liquid Common Lisp Version 5.0 - 3 OCT 1997

Generated with Harlequin WebMaker