Class
menu-object is the superclass of all menu objects, and provides functionality for handling generic aspects of menus, menu components and menu items. enabled Ifnil, the menu object is disabled, and cannot be selected.
popup-callbackCallback before the menu appears.
enabled-functionReturns non-nil if the menu is enabled.
enabled-slot The object is enabled if the slot is non-nil.
callbackThe selection callback for the object.
callback-data-functionA function to return data for the callback.
menu-object-enabled
menu-popup-callback
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. enabled-slot is a short-hand means of creating anenabled-function which checks the value of a slot in the menu object's interface. initarg 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.
(capi:contain (make-instance
'capi:menu-item
:text "Press Me"
:enabled-function #'(lambda (item)
(eq (random 2)
1))))
menumenu-itemmenu-component