Re: NSTableView
Re: NSTableView
- Subject: Re: NSTableView
- From: Ondra Cada <email@hidden>
- Date: Fri, 31 May 2002 02:53:20 +0200
On Thursday, May 30, 2002, at 11:44 , mmalcolm crawford wrote:
... and this, as Ondra appears to have mentioned back in April, is not
the best way to achieve the desired result.
Thanks ;)
You don't have to create your own attributed string, you can leave it up
to the cell, as per my example May 26:
- (void)tableView:(NSTableView *)tableView
willDisplayCell:(id)cell
forTableColumn:(NSTableColumn *)tableColumn row:(int)row
{
if (<test>) {
[cell setTextColor:[NSColor redColor]];
}
// strictly should also have:
else {
[cell setTextColor:[NSColor blackColor]];
}
}
Perhaps it's worth to point out that the else branch is *important* indeed
-- since one cell is re-used for all rows, without it the results would be
erratic and improper.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.