• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [coredata] populate NSPopupButton with NSAttributedStrings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >[coredata] populate NSPopupButton with NSAttributedStrings (From: "Pierre Chatel" <email@hidden>)
 >Re: [coredata] populate NSPopupButton with NSAttributedStrings (From: Jim Correia <email@hidden>)
 >Re: [coredata] populate NSPopupButton with NSAttributedStrings (From: "Pierre Chatel" <email@hidden>)
 >Re: [coredata] populate NSPopupButton with NSAttributedStrings (From: Scott Stevenson <email@hidden>)

  • Prev by Date: Anyone recognise this crash in loadNib?
  • Next by Date: Re: Anyone recognise this crash in loadNib?
  • Previous by thread: Re: [coredata] populate NSPopupButton with NSAttributedStrings
  • Next by thread: Issue with NSWindow -save/-setFrameUsingName:
  • Index(es):
    • Date
    • Thread