Re: ColoredRowTableView
Re: ColoredRowTableView
- Subject: Re: ColoredRowTableView
- From: Jonathan Jackel <email@hidden>
- Date: Sat, 12 Oct 2002 14:06:33 -0400
Here's a simplified version of how I do it. I believe I cribbed this from
mamasam.
In the table view delegate, put this:
- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell
forTableColumn:(NSTableColumn *)aTableColumn row:(int)aRowIndex
{
if ((aRowIndex % 2) == 0)
{
[aCell setDrawsBackground: YES];
[aCell setBackgroundColor: [NSColor colorWithCalibratedRed: 0.90
green: 0.90
blue: 0.80
alpha: 1.0]];
}
else
{
[aCell setDrawsBackground: NO];
[aCell setBackgroundColor: [NSColor whiteColor]];
}
}
I think this works best if the "stripe" color is a user preference set with
a color well. You never know what people will set their highlight color to.
Jonathan
on 10/11/02 9:56 AM, Terry Smyth at email@hidden wrote:
>
Hi,
>
>
Back in August, Bradford Brack posted a link to a really useful
>
NSTableView subclass he wrote (called ColoredRowTableView), to handle
>
alternate row coloring and various other things. I'd really like to use
>
this in my app, but the link to the code no longer seems to work. Does
>
anyone know where I might get hold of this code now?
>
>
I found Bradford's message by searching on cocoa.mamasam.com, though I
>
couldn't find the same message in Apple's cocoa archives.
>
>
Thanks in advance for any pointers.
>
>
Terry Smyth
>
_______________________________________________
>
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.