Re: NSButton Text Color?
Re: NSButton Text Color?
- Subject: Re: NSButton Text Color?
- From: "Alan Smith" <email@hidden>
- Date: Mon, 29 Jan 2007 08:55:52 -0500
Hi,
There is not a cell associated with the button, the string is drawn
directly. To change the color I would imagine something like this
should work:
- (void)setButtonTextColor:(NSColor*)color
{
NSAttributedString *attributedString = [[NSAttributedString alloc]
initWithString: [button title] attributes: [NSDictionary
dictionaryWithObjectsAndKeys: color, NSForegroundColorAttributeName,
nil]];
[button setAttributedTitle: attributedString];
}
Good luck, Alan
--
// Quotes from yours truly -------------------------
"You don't forget, you just don't remember."
"Maturity resides in the mind."
"Silence is the Universe's greatest gift."
"When the World realizes that religion really is unnecessary, then it
shall evolve."
_______________________________________________
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