Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / October 2005



Tip: Looking for answers? Try searching our database.

Buttons

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
paul - 20 Oct 2005 08:12 GMT
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];
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.