Re: Bindings / NSTableView (limitation ?)
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