views:

48

answers:

3

So basically I just want to have the user click on an NSButton, and have it disappear once it is clicked. How can I do that?

+1  A: 

-removeFromSuperview should do what you want:

NSbutton *myButton = button;

[myButton removeFrowSuperview];
ennuikiller
+2  A: 

NSButton is a sublcass of NSView, which has these two handy methods:

Whichever you need depends on what exactly your application should do.

Georg
+1 for the doc links
Dave DeLong
+2  A: 

Your button's action method might look like this:

-(IBAction)buttonClick:(id)sender
{
    [[self button] setHidden:YES];
}

It might be a better idea to disable it instead:

-(IBAction)buttonClick:(id)sender
{
    [[self button] setEnabled:NO];
}

Not a judgement call, just saying.

trudyscousin