Joshua
Joshua

Reputation: 15500

Making an NSButton inactive

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?

Upvotes: 1

Views: 2777

Answers (2)

Abizern
Abizern

Reputation: 150565

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

[myButton setHidden:YES];

Upvotes: 3

Rüdiger Hanke
Rüdiger Hanke

Reputation: 6255

Try [myButton setHidden:TRUE] instead of setTransparent:

Upvotes: 3

Related Questions