• 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: NSSearchField - detect loss of focus
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSearchField - detect loss of focus


  • Subject: Re: NSSearchField - detect loss of focus
  • From: Keith Wilson <email@hidden>
  • Date: Sat, 7 Jan 2006 15:00:47 +1100

Many thanks Matt,

I had previously tried overriding resignFirstResponder but it was too hard and too messy for what I'm doing.

Catching windowDidUpdate works fine.

Keith


On 07/01/2006, at 5:16 AM, Matt Neuburg wrote:

On Fri, 6 Jan 2006 23:26:17 +1100, Keith Wilson <email@hidden>
said:
I have an NSSearchField in my toolbar and the results of the search
are displayed in an NSTableView - very similar to the way it works in
OSX 10.4 in the search field in the Apple System Preferences panel.

After searching the user can
(a) select an item from the NSTableView or
(b) click anywhere else on the screen to indicate that they are no
longer interested in the search results.

For case (b) how do I detect when the NSSearchField loses keyboard
focus - so that  I can then hide the NSTableView?

Override resignFirstResponder? Actually I have to admit that, faced with
similar situations, what I generally do is to catch the windowDidUpdate
notification; these are sent whenever anything changes, including change of
focus, so you can check for the firstResponder and react accordingly. m.


--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>




_______________________________________________ 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
References: 
 >Re: NSSearchField - detect loss of focus (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: Crash in _blinkCaretTimerAction (NSTextView)
  • Next by Date: [Fwd: Re: NSTextView unarchived from nib missing pointing hand cursor over links?]
  • Previous by thread: Re: NSSearchField - detect loss of focus
  • Next by thread: Cocoa versus Carbon networking issue.
  • Index(es):
    • Date
    • Thread