0

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?

NSGod
  • 22,699
  • 3
  • 58
  • 66
Tom Shen
  • 1,838
  • 3
  • 19
  • 40

0 Answers0