Cocoa menu with images

I need to create a popup or dropdown menu in Cocoa that will contain an image or image with text as a representation of an element. Can anyone suggest a way that I could do this programmatically?

+2


source to share


1 answer


Any menu in Cocoa, whether in a menu bar, in a section, NSPopUpButton

or in a combo box, uses NSMenu

its menu to display. NSMenu

displays a list of NSMenuItem

s. Everyone NSMenuItem

has a method -[NSMenuItem setImage:]

. Have you tried this?



+16


source







All Articles