#KBButton
KBButton is a subclass of NSButton. It was adapted from http://github.com/mattlawer/BButton to work under Cocoa on Mac OS X.
Use CocoaPods and add to your Podfile
pod 'KBButton',
:git => 'git@github.com:dsci/KBButton.git',
:branch => 'master'
- Create a NSButton instance in interface builder.
- Set the class of the NSButton to KBButton
- Connect NSButton to IBOutlet through Interface Builder
- call [[button cell] setKBButtonType:BButtonTypeDefault] in awakeFromNib. In the example this is done in KBAppDelegate.m
Follow step 1 of the Changing the Color programatically section
Then call in awakeFromNib
:
- (void)awakeFromNib {
NSColor *facebookColor = [NSColor colorWithCalibratedRed:0.178
green:0.268
blue:0.525
alpha:1.000];
[[button cell] setKBButtonColor: facebookColor];
}
Follow step 1 of the Changing the Color programatically section. You may want to use your own color.
Then call in awakeFromNib
:
[[button cell] setKBButtonTextColor:[NSColor blackColor]];
Follow step 1 of the Changing the Color programatically section.
Then call in awakeFromNib
:
[[button cell] setKBButtonBorderColor: [NSColor whiteColor]];
This library is licensed under the MIT license.
If you would like to contribute or could improve the code, please submit a pull request or issue.