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
2010-10-17 16:26:22
+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
2010-10-17 16:27:31
+1 for the doc links
Dave DeLong
2010-10-17 17:57:33
+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
2010-10-17 16:29:58