Re: NSTextFieldCell text color issue in NSTableView with source list highlighting
Re: NSTextFieldCell text color issue in NSTableView with source list highlighting
- Subject: Re: NSTextFieldCell text color issue in NSTableView with source list highlighting
- From: Corbin Dunn <email@hidden>
- Date: Fri, 13 Mar 2009 10:02:59 -0700
A quick side note on this problem (which I have confirmed is a bug):
- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)
aCell forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)
rowIndex
{
// note that when the NSTableView Highlight mode is set to source
list
// setting the text color of NSTextFieldCell seems to misbehave.
if ([aCell isKindOfClass:[NSTextFieldCell class]]) {
if ([aCell isHighlighted]) {
Instead of doing [aCell isHighlighted], I recommend checking the
background style, ie: [cell backgroundStyle] ==
NSBackgroundStyleDark (etc..). This is what I was trying to say in the
old post:
http://www.cocoabuilder.com/archive/message/cocoa/2008/11/5/222008
But, even with that considered, the problem still happens with source
list tables.
--corbin
[aCell setTextColor: [NSColor lightGrayColor]];
} else {
[aCell setTextColor: [NSColor darkGrayColor]];
}
}
}
Has anyone else encountered this?
Work around solution is probably to use NSAttributedString.
Jonathan Mitchell
Central Conscious Unit
http://www.mugginsoft.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden