The class menu-object
is the superclass of all menu objects, and provides functionality for handling generic aspects of menus, menu components and menu items.
If nil
, the menu object is disabled, and cannot be selected.
Callback before the menu appears.
Returns non- nil
if the menu is enabled.
The object is enabled if the slot is non-
nil.
The selection callback for the object.
When the menu object is about to appear on the screen, the CAPI does the following:
popup-callback
(if there is one) is called with the menu object and it is allowed to make arbitrary changes to that object. nil
if the menu object is enabled. Note that enabled-slot
is a short-hand means of creating an enabled-function
which checks the value of a slot in the menu object's interface.
The callback initarg
is placed in the selection-callback
, extend-callback
and retract-callback
slots unless these are given explicitly, and so will get called when the menu object is selected or deselected. The callback-data-function
is a function that is called with no arguments and the value it returns is used as the data to the callbacks.
(capi:contain (make-instance
'capi:menu-item
:text "Press Me"
:enabled-function #'(lambda (item)
(eq (random 2)
1))))