• 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 set the color of a string on a NSButton?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to set the color of a string on a NSButton?


  • Subject: Re: How to set the color of a string on a NSButton?
  • From: Scott Stevenson <email@hidden>
  • Date: Wed, 22 Nov 2006 23:55:16 -0800


On Nov 22, 2006, at 11:10 PM, David Hinz wrote:

What is the easiest way to change the color of the string on a NSButton where string was set through Interface Builder?

You might be able to pull it off using NSFontDescriptor with NSFontColorAttribute, and then get an NSFont object to use on the button.


However...

It might not be an accident that this isn't easy. Drawing colored text over one of the stock buttons could look horrendously bad. They're designed for black text.

If you want a custom appearance, your best bet is to create an NSButtonCell subclass and do custom drawing.

   - Scott
_______________________________________________

Cocoa-dev mailing list      (email@hidden)

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


  • Follow-Ups:
    • Re: Re: How to set the color of a string on a NSButton?
      • From: "Philip Q" <email@hidden>
References: 
 >How to set the color of a string on a NSButton? (From: David Hinz <email@hidden>)

  • Prev by Date: Re: How to set the color of a string on a NSButton?
  • Next by Date: Safely cancelling modifications
  • Previous by thread: Re: How to set the color of a string on a NSButton?
  • Next by thread: Re: Re: How to set the color of a string on a NSButton?
  • Index(es):
    • Date
    • Thread