• 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: Auto enable/disable buttons...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Auto enable/disable buttons...


  • Subject: Re: Auto enable/disable buttons...
  • From: Mario Diana <email@hidden>
  • Date: Tue, 20 Jul 2004 17:36:15 -0400

On Tuesday, July 20, 2004, at 02:44 PM, Douglas A. Welton wrote:

I have a button on my user interface that I would like to automatically
enable or disable based on which interface view is the current first
responder.

I have a very small demo I refer to when I need code to enable/disable buttons and to make a button the default button. I've posted it here:

http://homepage.mac.com/mariox19/.cv/mariox19/Public/ button_example.tar.gz-link.gz

As to managing buttons based on who is the first responder, an NSView (NSResponder, actually) is sent the message "- (BOOL)becomeFirstResponder" when it's about to become so. There may be an easier way, but I'm thinking you subclass your view, overriding the above method to implement custom behavior.

Mario

=======================================================
Mario Diana Mobile: 845-380-8428
50 Forest Drive Home: 845-221-3989
Poughquag, NY 12570 Email: email@hidden
=======================================================
Programmer - Web development, Java, XML, LAMP, Mac OS X
=======================================================
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Auto enable/disable buttons... (From: "Douglas A. Welton" <email@hidden>)

  • Prev by Date: Re: Sending image from separate thread back to AppController
  • Next by Date: Bug in NSImageView?
  • Previous by thread: Re: Auto enable/disable buttons...
  • Next by thread: noteNewRecentDocumentURL?
  • Index(es):
    • Date
    • Thread