How can i display a list of i开发者_高级运维mages stored in an array as list item in pop up button.
If not possible, what can be the alternative way to do so.
NSMenuItem has a -setImage: method which allows you to assign a image to be displayed with the menu item in a popup button.
NSMenu has a number of methods which allow you to obtain the NSMenuItem's from it, like -itemWithTag:, itemWithTitle:, etc.
Furthermore, NSPopupButton has a number of methods which allow you to obtain the NSMenuItem's from it like, -itemArray, -itemAtIndex:, etc. and, of course, a -menu method which allows you to obtain its NSMenu directly.
If you want to let the user chose an image from a selection, you should consider ImageKit and its IKImageBrowserView
精彩评论