0

カスタム NSButtonCell を持つ NSButton があります。CustomButtonCell は次のようになります。

#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

これにより、ボタンが黄色になります。ボタンを押しても、選択した外観に変わりません(少し暗い)。選択した外観をどのように取得できますか?

4

0 に答える 0