Skip to content

Instantly share code, notes, and snippets.

@gabrielcsapo
Created April 30, 2015 23:15
Show Gist options
  • Save gabrielcsapo/7f7b4eb8b569fc911e82 to your computer and use it in GitHub Desktop.
Save gabrielcsapo/7f7b4eb8b569fc911e82 to your computer and use it in GitHub Desktop.
set background color for NSButton
// NSColor *color = [NSColor colorWithCalibratedRed:0.121f green:0.4375f blue:0.1992f alpha:0.2578f];
//
// [btnAdd setWantsLayer:YES];
// btnAdd.layer.backgroundColor = color.CGColor;
@maxmitch
Copy link

unfortunately not working

@eonist
Copy link

eonist commented Oct 24, 2015

//in swift:
(button.cell as! NSButtonCell).bordered = false//The background color is used only when drawing borderless buttons.
(button.cell as! NSButtonCell).backgroundColor = NSColor.redColor()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment