NSButton Set Text Color?
Is there a way to set the text color of a title in an NSButton in my code? I've been looking things up and trying for a bit now and I've come to the conclusion that, if you can do it, it's quite elaborate. Then again, I forgot a stupid thing with my last question so that may be the case again.
I'm pretty sure doing so goes against the Apple Human Interface Guidelines. That said, here's how it can be done:
NSColor *color = [NSColor redColor];
NSMutableAttributedString *colorTitle =
[[NSMutableAttributedString alloc] initWithAttributedString:[button attributedTitle]];
NSRange titleRange = NSMakeRange(0, [colorTitle length]);
Possibly Related Threads...
|Getting text from a window text field||mars||7||4,814||
Mar 26, 2005 06:06 PM
Last Post: OneSadCookie