Re: Themed colors, was NSTableView cell's drawing backgrounds
Re: Themed colors, was NSTableView cell's drawing backgrounds
- Subject: Re: Themed colors, was NSTableView cell's drawing backgrounds
- From: Glenn Howes <email@hidden>
- Date: Sat, 12 Oct 2002 11:39:38 -0500
Another postscript, my code doesn't work well in the case where the
column in question was editable, lost editing, and when I tried setting
the new cell to be editable, I lost hiliting and proper redraw, but the
following works fine in the context of my application.
-(void)awakeFromNib
{
// hack so certain columns don't draw white over the stripe
// from a suggestion by Phillip Hutchings on the cocoa-dev
mailing list
NSEnumerator* columns = [[self tableColumns] objectEnumerator];
NSTableColumn* aColumn = nil;
while(nil != (aColumn = [columns nextObject]))
{
if(![aColumn isEditable])
{
NSCell* aCell = [[[NSCell alloc] initTextCell: @""]
autorelease];
[aColumn setDataCell:aCell];
}
}
}
>
>
P.S. I took Phillip's code and made it a bit more pluggable:
>
>
-(void)awakeFromNib // in your striped NSTableView subclass
>
{
>
// hack so certain columns don't draw white over the stripe
>
// from a suggestion by Phillip Hutchings on the cocoa-dev
>
mailing list
>
NSEnumerator* columns = [[self tableColumns] objectEnumerator];
>
NSTableColumn* aColumn = nil;
>
while(nil != (aColumn = [columns nextObject]))
>
{
>
[aColumn setDataCell: [[[NSCell alloc] initTextCell: @""]
>
autorelease]];
>
}
>
}
>
>
>
On Saturday, October 12, 2002, at 05:16 AM, j o a r wrote:
>
>
> You can fix this by specifying a plain text cell type for the column
>
> in question, something like this:
>
>
>
> - (void) awakeFromNib
>
> {
>
> [tableColumn setDataCell: [[[NSCell alloc] initTextCell: @""]
>
> autorelease]];
>
> }
>
>
>
> I think, but I'm not sure, that Apple sometimes use some custom cell
>
> type for the table view - perhaps for the resizable columns - that
>
> always paints a white background before drawing.
>
>
>
> j o a r
>
>
>
> On Saturday, Oct 12, 2002, at 11:51 Europe/Stockholm, Phillip
>
> Hutchings wrote:
>
>
>
>> The problem is that, while the first two columns draw the background
>
>> normally, the 3 new columns are drawing solid white backgrounds on
>
>> the cells, and the blue stripes are showing through where the grid
>
>> would be. I've confirmed the problem by setting the table's
>
>> background in InterfaceBuilder, the first two columns are solid
>
>> colour (in this case peach), but the new 3 look like they have a
>
>> peach grid on.
>
> _______________________________________________
>
> 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.
_______________________________________________
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.