Hi,
My Nib file has a window with a button. In Cocoa, how do I programmatically
disable/enable the button?
Thanks,
Paul
Michael Ash - 20 Oct 2005 11:06 GMT
> Hi,
>
> My Nib file has a window with a button. In Cocoa, how do I programmatically
> disable/enable the button?
You'd read the docs for NSButton, including all of its superclasses, and
hopefully find NSControl's -setEnabled: method.

Signature
Michael Ash
Rogue Amoeba Software
Allen Brunson - 20 Oct 2005 11:27 GMT
> My Nib file has a window with a button. In Cocoa, how do I programmatically
> disable/enable the button?
1.) make an outlet for the button somewhere. the most likely spot would be in
the window's controller. connect the button to the outlet in interface
builder.
2.) at runtime, the outlet will be a pointer to an NSButton, so it's simply a
matter of calling:
BOOL state = TRUE; // or FALSE;
[button setEnabled:state];