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

Heirarchical pop up menus bug?



I'm attempting to create a heirarchical pop-up menu.
When I select an item on the submenu, the action for an item on the
top-level menu gets run!

Creating the menu with the code below, when I select "regular item",
[on the top-level menu] its action gets run correctly. 
If I move mouse to the submenu,
everything LOOKS fine, however, choosing "my item title"
[on the sub-menu]  causes the menu item action for "regular item" to be run.

This behavior seen in MCL2.0f2
(setq pop1
 (make-instance 'pop-up-menu
    :menu-title "top menu"
    :menu-items (list 
                 (make-instance 'menu-item
                                  :menu-item-title "regular item"
                                  :menu-item-action 
                                        #'(lambda () 
                                            (print-db 
                                             "in menu item action for regular item."
                                             )))
                 (make-instance 'pop-up-menu
                   :menu-title "submenu"
                   :menu-items (list 
                                (make-instance 'menu-item
                                  :menu-item-title "my item title"
                                  :menu-item-action 
                                        #'(lambda () 
                                            (print-db 
                                             "in menu item action for my item title."
                                             ))))))))

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