8.5 Disabling menu items

A function can be specified via the :enabled-function keyword, that determines whether or not the menu, menu item, or menu component is enabled. By default, a menu object is always enabled.

Consider the following example:

(defvar *on* nil)
 (make-instance 'menu
                 :title "Foo"
                 #'(lambda (menu) *on*))
                 :title "Bar"))))

Figure 8.7 A menu with a disabled menu item

Changing the value of *on* between t and nil in the Listener, using setq , results in the menu item changing between the enabled and disabled states.

LispWorks CAPI User Guide (Windows version) - 14 Jun 2006