• 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: Finding which control is selected
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding which control is selected


  • Subject: Re: Finding which control is selected
  • From: Douglas Davidson <email@hidden>
  • Date: Thu, 18 Oct 2001 15:42:57 -0700

On Thursday, October 18, 2001, at 01:38 PM, Brian Webster wrote:

Probably the best way to go about this is to hook up your appropriate controller object as the delegate of both text fields and implement the controlTextDidBeginEditing: and controlTextDidEndEditing: methods. The single argument is an NSNotification, and the notification's object will be the NSTextField that has just gained or lost the focus. You can use this to keep track of which text field (if any) is being edited at any given time.

You don't have to be the delegate to do this--any object can register for these notifications. You can register for the NSControlTextDidBeginEditingNotification for particular controls, or just register to receive it for any control. That's the programmatic way to do it.

If you're in the debugger, and trying to figure out who has focus, try looking at the field editor's delegate.

Douglas Davidson


References: 
 >Re: Finding which control is selected (From: Brian Webster <email@hidden>)

  • Prev by Date: Re: [Q]: Object ownership, undos, tableview, etc.
  • Next by Date: run application with console or shell
  • Previous by thread: Re: Finding which control is selected
  • Next by thread: Re: problem displaying html in NSTextView...
  • Index(es):
    • Date
    • Thread