开发者

Listing images in pop up button

开发者 https://www.devze.com 2022-12-24 18:30 出处:网络
How can i display a list of i开发者_高级运维mages stored in an array as list item in pop up button.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号