• 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: How to detect focus on an NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to detect focus on an NSTextField


  • Subject: Re: How to detect focus on an NSTextField
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 8 Feb 2008 08:02:54 -0800


On 8 Feb '08, at 1:56 AM, Joachim Deelen wrote:

what about NSWindow firstResponder? This Method returns the Object, that currently handles all Keyboard and Mouse Events at first.

The gotcha is that a text field itself is never the first responder. Instead, the first responder is the window's fieldEditor, which is a shared NSTextView that's used to manage text editing in whichever text field (or text cell) is active.


What you need to do is check that the text field's currentEditor is non-nil, and that the currentEditor itself is the window's firstResponder.

—Jens_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How to detect focus on an NSTextField
      • From: Adam Gerson <email@hidden>
References: 
 >How to detect focus on an NSTextField (From: Adam Gerson <email@hidden>)
 >Re: How to detect focus on an NSTextField (From: Joachim Deelen <email@hidden>)

  • Prev by Date: Re: Encryption Frameworks in Cocoa
  • Next by Date: Re: Catching Cocoa application Crash
  • Previous by thread: Re: How to detect focus on an NSTextField
  • Next by thread: Re: How to detect focus on an NSTextField
  • Index(es):
    • Date
    • Thread