Lisp HUG Maillist Archive

menus and menu-items

Hi,

Am I missing something here? Can't get the menu-items to appear in the 
pop-up menu.
Works, for example, with editor-pane and graph-pane:

;---- example: LWM4.3 ----

(defclass my-text-input-choice(capi:text-input-choice)
   ())

(capi:define-interface my-dialog ()
   ()
   (:panes
    (text-input-pane my-text-input-choice)))

(defun my-callback(&rest args)
   args)

(defmethod capi:pane-popup-menu-items ((self my-text-input-choice) 
(interface my-dialog))
   (list*
    (make-instance 'capi:menu
                   :title "Macros"
                   :items (mapcar #'(lambda(x) (make-instance 
'capi:menu-item :title x)) '("1" "2"))
                   :selection-callback 'my-callback)
    (call-next-method)))

(capi:display (make-instance 'my-dialog))

;----- END -----

Another thing, is it possible to add menus/menu-items to the LispWorks 
main menubar so that they would be visible to all editors, the Listener 
and any subsequent capi-interface (a la Window menu, for example)?

Regards,

Mika


Re: menus and menu-items

Unable to parse email body. Email id is 1760

Re: Q: capi:define-menu and submenus

"Dmitri Ivanov" <divanov@aha.ru> writes:

> Hello lispworkers,
>
> capi:define-menu is quite a convenient feature to put menu items and
> components into a single place. But what about submenus? The documentation
> is vague about what types of objects are allowed. In LWW 4.3, I have
> completely failed
> trying to define a menu with submenus included.
>
> Any takers?
I'm probably missing something but this
(defun test-menu ()
 (let* ((m1  (make-instance 'menu
                 :title "Bar"
                 :items '("One" "Two" "Three" "Four")
                 :callback 'test-callback))
        (m2    (make-instance 'menu
                 :items (list 1 2 m1 4 5)
                 :callback 'test-callback)))
   (contain m2)))
works it's under 7.1 in the CAPI User Manual. 

Regards
Friedrich


Updated at: 2020-12-10 08:58 UTC