[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

selecting a pop-up menu item



I've got a quick pop-up-menu question (the doc are very sparse).
I've defined a pop-up-menu with several items, but I need to change the 
selection under program control (instead of having the user click on it).

Using the function (menu-select my-pop-up n) with n being some integer,
does not seem to change the menu item as it is displayed.

As an example, using the pop-up-menu.lisp file, example  I would 
like to have:

(defvar my-pop-up
      (make-instance 'pop-up-menu
                     :dialog-item-text "Wowie"
                     :menu-items
                     (list
                      (make-instance 'menu-item
                                     :menu-item-title "item one"
                                     :menu-item-action #'(lambda ()
                                                           (print 1)))
                      (make-instance 'menu-item
                                     :menu-item-title "item two"
                                     :menu-item-action #'(lambda ()
                                                           (print 2)))
                      (make-instance 'menu-item
                                     :menu-item-title "item three"
                                     :menu-item-action #'(lambda ()
                                                           (print 3)))
                      (make-instance 'menu-item
                                     :menu-item-title "item fourteen"
                                     :menu-item-action #'(lambda ()
                                                           (print 14))))))

(defvar my-dial (make-instance 'dialog
                             :view-size #@(180 60)
                             :window-title "Pop-up Menu Test"
                             :view-subviews (list my-pop-up)))

;;; What I want is to be able to use

(menu-select my-pop-up 2)
(menu-select my-pop-up 1)

;; to change the menu that is displayed

       Jeffrey


======================================
Jeffrey Kane, MD
Kane Biomedical Systems
Boston, MA

Internet    jbk@world.std.com
Compuserve  74206,640
AppleLink   D0738

[Don't take life too seriously... it's not like anyone gets out of it alive.]