Re: Enable Buttons
Re: Enable Buttons
- Subject: Re: Enable Buttons
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Fri, 1 Jul 2005 20:33:07 +0200
On 01.07.2005, at 14:40, Sherm Pendley wrote:
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.
I tried this. Cocoa does indeed the Right Thing in sending the action
to the current document.
But it does not disable the butten when there is not document at all.
What am I doing wrong?
Kind regards,
Gerriet.
_______________________________________________
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