views:

226

answers:

2

What I want to do is as simple as hide a button. Currently I have used the code …

[myButton setTransparent:TRUE]

… that works BUT if you click where the button is and even though it's hidden whatever it's action is still happens. Is there a way to disable the NSButton?

+2  A: 

Try [myButton setHidden:TRUE] instead of setTransparent:

Rüdiger Hanke
WORKS PERFECTLY! MANY THANKS!
Joshua
You can also do [myButton setEnabled:NO], to have the button grey out, like the standard 'disabled' button in most apps.
bobDevil
I see, thanks again.
Joshua
+1  A: 

Probably just a style thing, but Cocoa uses YES and NO for BOOLs I'd write this instead.

[myButton setHidden:YES];
Abizern
I find that both work, but thanks for the advice.
Joshua