Re: Getting Text Colors Right for Derived NSTextFieldCell under Various Conditions
Re: Getting Text Colors Right for Derived NSTextFieldCell under Various Conditions
- Subject: Re: Getting Text Colors Right for Derived NSTextFieldCell under Various Conditions
- From: Grant Erickson <email@hidden>
- Date: Fri, 04 Dec 2009 19:54:20 -0800
- Thread-topic: Getting Text Colors Right for Derived NSTextFieldCell under Various Conditions
On 12/4/09 6:59 PM, Jim Correia wrote:
> On Dec 4, 2009, at 1:52 PM, Grant Erickson wrote:
>
>> I have implemented a custom class that derives from NSTextFieldCell to draw
>> status for an associated device (not unlike the network source list in the
>> Network System Preferences) overriding only:
>
> []
>
>> The issue I am having is determining the correct set of conditionals to use
>> to determine when to invert the color of my text strings from
>> backgroundColor (when the cell is selected and the associated table has
>> focus) to textColor (when the cell is not selected or is selected and does
>> not have focus).
>
> In general, the way to do this is to send -interiorBackgroundStyle to
> yourself, and pick a foreground text color suitable for the background.
Jim,
Thanks for the prompt reply. I forgot to mention one key element. The
subclass must support 10.4- and later so I cannot rely on 10.5- and later
APIs such as this.
Regards,
Grant
_______________________________________________
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