Gradient NSOutlineView row - Text color of it's NSTextFieldCell
Gradient NSOutlineView row - Text color of it's NSTextFieldCell
- Subject: Gradient NSOutlineView row - Text color of it's NSTextFieldCell
- From: Florian Soenens <email@hidden>
- Date: Sat, 28 Jul 2007 11:44:12 +0200
Hi list,
i'm struggling with the following:
i subclassed an nsoutlineview to implement the gradient look when
rows are selected.
The cells of a specific row are of class ImageAndTextCell, like the
ones in the DragDropTableView example.
The code in my ImageAndTextCell class to change the text color when
the cell (the row) is hilighted is the following:
- (NSColor *)textColor
{
if([self isHighlighted])
{
return [NSColor selectedMenuItemTextColor];
}
else
{
return [NSColor controlTextColor];
}
}
In my NSOutlineView i also overwrite the private method
_highlightColorForCell to get rid of the color this method is returning.
The problem is that this method also takes care of changing the
textcolor to black again when the text is selected.
In my case the textcolor stays white, no mather what. This causes the
text to be unreadable when it is selected.
I can't find a method anywhere to check whether the text is selected
like "istextSelected" or so. What should i do?
Any help is much appreciated...
Flor.
_______________________________________________
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