Re: [coredata] populate NSPopupButton with NSAttributedStrings
Re: [coredata] populate NSPopupButton with NSAttributedStrings
- Subject: Re: [coredata] populate NSPopupButton with NSAttributedStrings
- From: Jim Correia <email@hidden>
- Date: Sun, 8 Jul 2007 18:23:32 -0400
On Jul 8, 2007, at 2:29 PM, Scott Stevenson wrote:
On Jul 8, 2007, at 5:10 AM, Pierre Chatel wrote:
So, if I understand you correctly, there is no way to populate an
NSPopupButton with NSAttributedStrings by using default bindings.
Since
NSMenuItem does have an setAttributedTitle: method, should I subclass
NSPopupButton to add a new binding ?
I think the simplest design would be to keep a parallel array of
strings that is kept in sync with the attributed strings, then bind
the popup to those.
If you don't need to display attributed strings, then using the
contentValues binding with a value transformer is probably the right
solution. (You don't need to "pollute" your model with the non-
attributed strings if this is just for viewing.)
If you need to display attributed strings, then you'll need to use
some alternative method since the built-in binding only supports
strings.
Jim
_______________________________________________
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