• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Enable Buttons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Enable Buttons
      • From: "M. Uli Kusterer" <email@hidden>
References: 
 >Enable Buttons (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Enable Buttons (From: Sherm Pendley <email@hidden>)

  • Prev by Date: ArrayInUserDefaults Bindings example updated for Tiger
  • Next by Date: Re: AppleScript and plug-ins
  • Previous by thread: Re: Enable Buttons
  • Next by thread: Re: Enable Buttons
  • Index(es):
    • Date
    • Thread