0

I just want to add a simple NSButton with setAction in a custom NStextFieldCell... But my processor takes over 100%...

My code is as follows in my custom NStextFieldCell Class :

- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
...
NSButton *myButton = [[NSButton alloc] initWithFrame:NSMakeRect(cellFrame.origin.x+200, cellFrame.origin.y+5, 30, 30)];
[controlView addSubview: myButton];
[myButton setTitle: @"Button title!"];
[myButton setButtonType:NSMomentaryLightButton]; 
[myButton setBezelStyle:NSRoundedBezelStyle]; 
[myButton setTarget:self];
[myButton setAction:@selector(myAction)];

...
}

Any Idea ? Thanks

Le roukin
  • 95
  • 1
  • 10

0 Answers0