Borderless NSButton turns gray when clicked
Make your button type as NSMomentaryChangeButton. [myBtn setButtonType:NSMomentaryChangeButton]; If you use NSMomentaryPushInButton then you may get gray rectangle over the button when click.
Make your button type as NSMomentaryChangeButton. [myBtn setButtonType:NSMomentaryChangeButton]; If you use NSMomentaryPushInButton then you may get gray rectangle over the button when click.
Here is two other solutions: http://denis-druz.okis.ru/news.534557.Text-Color-in-NSButton.html solution 1: -(void)awakeFromNib { NSColor *color = [NSColor greenColor]; NSMutableAttributedString *colorTitle = [[NSMutableAttributedString alloc] initWithAttributedString:[button attributedTitle]]; NSRange titleRange = NSMakeRange(0, [colorTitle length]); [colorTitle addAttribute:NSForegroundColorAttributeName value:color range:titleRange]; [button setAttributedTitle:colorTitle]; } solution 2: in *.m file: – (void)setButtonTitleFor:(NSButton*)button toString:(NSString*)title withColor:(NSColor*)color { NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init]; [style setAlignment:NSCenterTextAlignment]; NSDictionary *attrsDictionary … Read more