Images in NSPopupMenu items when binded to a NSArrayController
Images in NSPopupMenu items when binded to a NSArrayController
- Subject: Images in NSPopupMenu items when binded to a NSArrayController
- From: "Pierre Chatel" <email@hidden>
- Date: Mon, 5 May 2008 18:03:28 +0200
Hi List,
I need to populate a an NSPopupMenu with items having both a title and an
image attached.
This NSPopupMenu is binded, via InterfaceBuilder, to an NSArrayController
managing instances having both a "title" (NSString *) and "image" (NSImage
*) property.
Problem is, there is only one "Content Value" binding available on the
NSPopupMenu, so I bound it to arrangedItems.title and thus, no images in the
popup menu :/
I thought there was hope binding "Content Value" to an NSAttributedString
property (containing both the image and the title) but it seems it only
accepts NSStrings !
So, what do you think is the best option for me to populate an NSPopupButton
with text and images while still using cocoa bindings ?
(I tried setting the NSArrayController as a delegate to the NSMenu
underlying the NSPopupButton but it wasn't working very well).
Thanks !
Pierre CHATEL.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden