Re: Color entire table view row
Re: Color entire table view row
- Subject: Re: Color entire table view row
- From: Max Horn <email@hidden>
- Date: Sun, 7 Apr 2002 13:57:17 +0200
At 13:25 Uhr +0200 07.04.2002, Ondra Cada wrote:
On Sunday, April 7, 2002, at 01:04 , Matt Massicotte wrote:
One thing I don't get: isn't it true that NSTableColumn by default
has only one dataCell that it shares with the entire column. I
know that setting it's text color changes the entire column's text
color. Wouldn't tableView:willDisplayCell:forTableColumn:row: just
return that same one Cell every time?
Of course it would. And you would set its attributes for each row differently.
Normally I like to argue with Ondra :-) but I have to back him here.
I have used exactly the technique he describes to color the rows in
my app (similiar to Mail.app), and it works just fine. Adding this
took me indeed under 10 minutes (just to counter Erik's contrary
claim), and I don't notice a speed penalty either (although I am only
using a handful of columns with many rows); I doubt that a method
that allows to set the back color on a per-row-base would be easier
to use or faster. OTOH, I believe it would be much less flexible,
considering that my table can be sorted, items be added/removed etc.
all the time, so I don't know how I'd do it properly without a
delegate method that dynamically determines the backcolor based on
the row contents.
Max
--
-----------------------------------------------
Max Horn
Software Developer
email: <
mailto:email@hidden>
phone: (+49) 6151-494890
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.