Re: [coredata] populate NSPopupButton with NSAttributedStrings
Re: [coredata] populate NSPopupButton with NSAttributedStrings
- Subject: Re: [coredata] populate NSPopupButton with NSAttributedStrings
- From: "Pierre Chatel" <email@hidden>
- Date: Sun, 8 Jul 2007 14:10:41 +0200
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 ?
Or is there a simpler way ?
Pierre
On 7/7/07, Jim Correia <email@hidden> wrote:
On Jul 7, 2007, at 10:41 AM, Pierre Chatel wrote:
> I'm binding a NSPopupButton to a core data controller but it
> refuses to
> display NSAttributedStrings.
We have a terminology problem. The controllers aren't Core Data
specific, but can be used with Core Data. As such, they are just
controllers, not Core Data controllers. For your question below, it
really doesn't matter if the data comes from an NSManagedObject or not.
> I have implemented a method to return a NSAttributedString (image +
> string)
> in my NSManagedObject subclass and call this method from the
> 'contentValues'
> binding of the NSPopupButton but it displays gibberish when I
> launch the
> application.
What specific gibberish are you seeing?
If you look at the documentation for the contentValues binding of
NSPopUpButton, it expects you to give it a string, not an attributed
string.
<http://developer.apple.com/documentation/Cocoa/Reference/
CocoaBindingsRef/BindingsText/NSPopUpButton.html>
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
_______________________________________________
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