1 CAPI Reference Entries

menu-object

Class

Summary

The classmenu-object is the superclass of all menu objects, and provides functionality for handling generic aspects of menus, menu components and menu items.

Superclasses

callbacks

Subclasses

titled-menu-object

Slots

enabled
Ifnil, the menu object is disabled, and cannot be selected.

popup-callback

Callback before the menu appears.

enabled-function

Returns non-nil if the menu is enabled.

enabled-slot
The object is enabled if the slot is non-nil.

callback
The selection callback for the object.

callback-data-function

A function to return data for the callback.

Accessors

menu-object-enabled
menu-popup-callback

Description

When the menu object is about to appear on the screen, the CAPI does the following:

1. Thepopup-callback (if there is one) is called with the menu object and it is allowed to make arbitrary changes to that object.

2. The enabled function (if there is one) is called with the interface, and it should return non-nil if the menu object is enabled.

3. The menu containing the object appears with all of the changes made.

Note thatenabled-slot is a short-hand means of creating anenabled-function which checks the value of a slot in the menu object's interface.

The callbackinitarg is placed in theselection-callback,extend-callback andretract-callback slots unless these are given explicitly, and so will get called when the menu object is selected or deselected. Thecallback-data-function is a function that is called with no arguments and the value it returns is used as the data to the callbacks.

Example

(capi:contain (make-instance
               'capi:menu-item
               :text "Press Me"
               :enabled-function #'(lambda (item)
                                     (eq (random 2)
                                     1))))

See Also

menu
menu-item
menu-component


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

Generated with Harlequin WebMaker