Re: Enable Buttons
Re: Enable Buttons
- Subject: Re: Enable Buttons
- From: Sherm Pendley <email@hidden>
- Date: Fri, 1 Jul 2005 08:40:39 -0400
On Jul 1, 2005, at 7:25 AM, Gerriet M. Denkmann wrote:
I have a document based app, which has a panel (a find panel) with
a button (Find Next).
This button obviously should be enabled if and only if
[[ NSDocumentController sharedDocumentController] currentDocument]
is non-nil.
My guess is I should use bindings to accomplish this.
Is this correct? If yes, how to do it? If no, what is the most
elegant way to choose?
I'd add a doFindNext: method to the First Responder in IB, and
connect the button to that. Then, add that method to your document
class. Cocoa will do the Right Thing(tm), sending the action to the
current document and disabling the button if none of the objects in
the responder chain respond to the specified action.
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Enable Buttons (From: "Gerriet M. Denkmann" <email@hidden>) |