How to best share an NSMenu between multiple NSPopUpButton instances

Posted by Frank R. on Stack Overflow See other posts from Stack Overflow or by Frank R.
Published on 2010-05-19T14:28:02Z Indexed on 2010/05/19 14:30 UTC
Read the original article Hit count: 245

Filed under:

Hi,

I need to share the same NSMenu instance between multiple popup buttons.

When I create an NSPopUpButton in IB, a new menu is automatically created and inserted as a child of the NSPopUpButtonCell.

At the moment, I simply create an IBOutlet NSMenuItem* standardMenu member in my MainController and connect the "menu" outlets of the popup buttons to this, but this leaves the "fake" menus in the hierarchy.

Surely, there's a clean way of doing this from inside IB?

Thanks in advance for any advice you might be able to give.

© Stack Overflow or respective owner

Related posts about cocoa