Lisp HUG Maillist Archive

Popup menus on Cocoa

Hi,

I'm on Cocoa, and would like to add a delegate to a popup menu. Working with "ordinary" menus works fine, but with popup menus, I can't find a point to get the internal NSMenu object:

(let ((menu (make-instance 'capi:menu ...)))

  ;; too early, representation is nil
  (capi:display-popup-menu menu)
  ;; too late, menu is already gone


Using the popup-callback of the menu doesn't work either, because it seems to be called before the underlying NSMenu is constructed (or at least, before the representation slot of capi:menu is assigned).

Ideas?

Erik



_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


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