I want a simple push button (the one with the round corners), and to add background to it. I\'ve tried 2 things:
1 - using a round button image: this is working good, un
Override NSButtonCell's drawWithFrame method:
func drawWithFrame(cellFrame: NSRect, inView controlView: NSView) {
var border = NSBezierPath(roundedRect: NSInsetRect(cellFrame, 0.5, 0.5), xRadius: 3, yRadius: 3)
NSColor.greenColor().set()
border.fill()
var style = NSParagraphStyle.defaultParagraphStyle()
style.alignment = NSCenterTextAlignment
var attr = [NSParagraphStyleAttributeName : style, NSForegroundColorAttributeName : NSColor.whiteColor()]
self.title.drawInRect(cellFrame, withAttributes: attr)
}