• 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: Bindings / NSTableView (limitation ?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings / NSTableView (limitation ?)


  • Subject: Re: Bindings / NSTableView (limitation ?)
  • From: Fritz Anderson <email@hidden>
  • Date: Wed, 27 Jun 2007 11:38:48 -0500

On 27 Jun 2007, at 11:24 AM, Daniel Angermeier wrote:

I would like to dinamically change the color of particluar rows in a
table view, depending on app state.
Before I was using the table view data source approach,
and this was failrly easy to do,
by just returning a stringWithAttributes in

-(id)tableView:(NSTableView *)aTableView
 objectValueForTableColumn:(NSTableColumn *)aTableColumn
 row:(int)rowIndex

However, I am doing all of this with bindings now and
I can't figure out how to achieve the above mentioned effect.

I don't have a developed solution for you (it may not even be workable; I'm on a run of "solutions" that only inspire others to intervene with the correct information), but I'd start with the NSTableViewDelegate method tableView:willDisplayCell:forTableColumn:row: .


From the row parameter, you could determine (from the controller's arrangedObjects array) what the underlying data is, and set the background of the cell accordingly. You'll have to set both highlighted and unhighlighted backgrounds yourself.

	— F

_______________________________________________

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: 
 >Bindings / NSTableView (limitation ?) (From: "Daniel Angermeier" <email@hidden>)

  • Prev by Date: Re: Correct approach?
  • Next by Date: Re: How to detect clipping of text in NSTextView?
  • Previous by thread: Re: Bindings / NSTableView (limitation ?)
  • Next by thread: didFinishPlaying NSSound
  • Index(es):
    • Date
    • Thread