I have an NSButton with a custom NSButtonCell. CustomButtonCell looks like:
#import "CustomButtonCell.h"
@implementation CustomButtonCell
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
CALayer *viewLayer = [CALayer layer];
[viewLayer setBackgroundColor:self.backgroundColor.CGColor];
[controlView setWantsLayer:YES];
[controlView setLayer:viewLayer];
}
@end
This makes the button yellow. Now when I press the button, it doesn't change into the selected look(a bit darker). How can you get the selected look back?