Re: NSSearchField - detect loss of focus
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