Change NSTextFieldCell textColor when text is selected
Change NSTextFieldCell textColor when text is selected
- Subject: Change NSTextFieldCell textColor when text is selected
- From: Florian Soenens <email@hidden>
- Date: Mon, 23 Jul 2007 12:58:51 +0200
Hi list,
i'm struggling with the following:
i subclassed an nsoutlineview and the cells of a specific row are
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];
}
}
However, i would like to be able to check if the text is selected so
i can change the color to black, because if your background color is
green or light pink or whatever, the text is nor readable anymore.
iPhoto implements this behavior, so it should be possible...
I can't find a method anywhere like "istextSelected" or so. What
should i do?
Any help is muchos 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