• 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: 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


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

  • Prev by Date: Re: Using gcc 2 on 10.4.1 with XCode 2.1. Confirmation request.
  • Next by Date: Setting ignoredWords for a NSTextView
  • Previous by thread: Enable Buttons
  • Next by thread: Re: Enable Buttons
  • Index(es):
    • Date
    • Thread