From: su (Gerd Sutschet)

Subject: Re: Modifying pop-up menu dynamically?

Date: 1996-11-11 4:50


> > Is there a way to dynamically modify a pop-up menu? Lets say there are 3 > menu items optA, optB and optC. Sometimes I want to disable optA. Is > there a way to do it? (I prefer to grey-out this menu item. But deleting > the menu item and reinserting it later is also ok)
Yes! Use function cg:set-menu-item-availaable-p In your example: Suppose your dialog is boud to *example-dialog* and the menu-items have names :optA, :optB, and :optC. Then you could write functions (defun set-menu-item-inactive (menu-item-name dialog) (cg:set-menu-item-availaable-p (cg:find-named-object menu-item-name dialog) NIL) ) (defun set-menu-item-active (menu-item-name dialog) (cg:set-menu-item-availaable-p (cg:find-named-object menu-item-name dialog) T) ) Call to function (set-menu-item-inactive :optA *example-dialog*) will turn this menu-item inavtive Call to function (set-menu-item-active :optA *example-dialog*) will turn it avtive again. This should do the job. Hope that helps. Gerd -------------------------------------------------------------------------- Gerd Sutschet Fraunhofer IITB E-mail: <iitb.fhg.de at sutschet> Fraunhoferstr. 1 Phone: (+49)721 / 6091-370 D - 76131 Karlsruhe Fax: (+49)721 / 6091-413 --------------------------------------------------------------------------