6 Creating Menus
:enabled
keyword tonil
. In addition, a function can be specified via the:enabled-function
keyword, that determines whether or not the menu, menu item, or menu component is enabled. Consider the following example:
(defvar *on* t)Toggling the value of(setq menu (make-instance 'menu-item :title "Foo" :enabled-function #'(lambda (menu) *on*)))
(contain menu)
*on*
betweent
andnil
in the listener, usingsetq
, results in the menu item toggling between an enabled and disabled state.
Generated with Harlequin WebMaker