• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to disable/gray an NSTextfield (used as static text)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to disable/gray an NSTextfield (used as static text)


  • Subject: Re: How to disable/gray an NSTextfield (used as static text)
  • From: Dave MacLachlan <email@hidden>
  • Date: Thu, 20 Jul 2006 15:30:35 -0700

The text field on the right was set to disabledControlTextColor *within
IB* (via Developer color palette). The text field on the left is set to
disabledControlTextColor *with setTextColor:*. Yet they don't match. As
you say, if I use secondarySelectedControlColor, they match.


Why is that?

To resurrect a age-old thread that never really got resolved..

4642547 Static Text in Cocoa draws "disabled" incorrectly

So I did some research on this because I was running into problems with it as well...basically here's what I found.

Take a look at this screen shot of IB:

http://homepage.mac.com/dmaclach/bugs/radar4642547.png

NSTextFields DO change color when they are disabled, however I think somebody was trying to be clever and change the brightness and changed it the wrong way. Black gets blacker when it should be getting lighter. This means that the standard workaround of using [NSColor secondarySelectedControlColor] is wrong...it just happens to work-out that the secondarySelectedControlColor is the right "lightness" that when it is darkened appropriately it looks about right.

I really think that "disabled" shouldn't lighten the color, but instead should set the color equivalent to "kThemeTextColorPopupLabelInactive" or [NSColor disabledControlTextColor].

This probably explains the differences that you are/were seeing Sean. Hopefully they'll figure out someway to fix this instead of having everyone subclass and do it incorrectly.

Cheers,
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: NSBrowserCell not extensible; need sample using NSButtonCell
  • Next by Date: Re: NSBrowserCell not extensible; need sample using NSButtonCell
  • Previous by thread: NSURLProtocol thread safety
  • Next by thread: strpos-type method
  • Index(es):
    • Date
    • Thread