How to add multiple menu items with the same title to NSPopUpButton(NSMenu)?

Posted by William S. Pear on Stack Overflow See other posts from Stack Overflow or by William S. Pear
Published on 2010-02-23T16:56:43Z Indexed on 2010/04/17 0:03 UTC
Read the original article Hit count: 405

Filed under:
|
|
|
|

As docs say it's impossible to add two menu items to NSPopUpButton if they both have the same title. I was trying to add menu items to [popupButton menu], but with no luck. I was also trying to create a new menu, add items to it and then use [popupButton setMenu:newMenu], but no. Menu always display only one item per name.

But I know it should be possible, if you try to create a smart playlist in iTunes, you could select "Playlist" from the left popup button, "=" from the middle, and the right one will hold menu items for every playlist in iTunes EVEN if they have the same title. So how do they do it?

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about nsmenu