(resend, with the rest of the email, sorry!)

On Nov 5, 2008, at 5:30 PM, Andre Masse wrote:

Hi,

When selecting a row in a NSTableView, the default highliting (white text on blue background) doesn't work if the text is not black. Is there a setting somewhere (in IB) or a method to implement/override to fix that? I have a column's cell with its foreground color set to gray and it's almost unreadable when the row is selected. I could make my own NSTextFieldCell subclass and override - isHighlited but would prefer not to.

If you set an explicit color on the cell, then it doesn't know it should flip the black text to white text when it is selected (in other words, it has no way of knowing that what you set it to isn't what you really wanted). So, in -willDisplayCell, you will have to set the text color to white yourself.

You can set the text color to gray if the [cell backgroundStyle] == NSBackgroundStyleLight and the text to white otherwise. It should be easy to do, and not require subclassing. Also, subclassing and overriding -isHighlighted wouldn't have given you the effect you wanted.

corbin

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to