Re: NSTableView
Re: NSTableView
- Subject: Re: NSTableView
- From: Matthew Johnson <email@hidden>
- Date: Mon, 27 May 2002 16:40:28 +1000
That did it Malcolm.
Thanks :)
mmalcolm crawford wrote:
>
On Sunday, May 26, 2002, at 10:51 PM, Brendan Younger wrote:
>
>
>> If I had a table that had a list of names in it and I wanted all the
>
>> names that contained a 'd' to appear red instead of black like the
>
>> rest of the names.
>
>
>
> You have to supply your own NSCell subclass which will then color the
>
> names however you want. See the DragNDropOutlineView (in the Examples
>
> directory of the dev tools installation) for an example of how to do
>
> this.
>
>
>
This generally turns out not to be the case.
>
The default cell is likely to be an NSTextFieldCell, so you could use:
>
>
- (void)tableView:(NSTableView *)tableView
>
willDisplayCell:(id)cell
>
forTableColumn:(NSTableColumn *)tableColumn row:(int)row
>
{
>
if (<test>) {
>
[cell setTextColor:[NSColor redColor]];
>
}
>
}
>
>
mmalc
>
_______________________________________________
>
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.
_______________________________________________
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.