Mike2012
Mike2012

Reputation: 7725

Cocoa menu with images

I need to make a popup or pull down menu in Cocoa that will contain either an image or an image with text as the representation of the item. Can anyone suggest a way I could do this programatically?

Upvotes: 2

Views: 1825

Answers (1)

Dave DeLong
Dave DeLong

Reputation: 243156

Any sort of menu in Cocoa, whether it's in the menubar, part of an NSPopUpButton, or a combobox, uses NSMenu to display its menu. The NSMenu displays a list of NSMenuItems. Each NSMenuItem has a -[NSMenuItem setImage:] method. Have you tried that?

Upvotes: 16

Related Questions