Re: How to set the color of a string on a NSButton?
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