Window focus events in Cocoa
I have an application with a single (ns)window, and I'm trying to figure out how to detect window focus events like when it's minimized to the dock or the user is focused on another application, or if the window is on another space in Leopard.
I've read some documentation on event handling, but nothing seems to be mentioned about window focus events. What am I missing?
I've read some documentation on event handling, but nothing seems to be mentioned about window focus events. What am I missing?
There are relevant methods in the "Managing Key Status" section of the NSWindow documentation. Also the "Managing Active Status", "Hiding Applications", "Managing Windows" sections of the NSApplication docs.
OK. From reading those it looks like my best bet is to give my NSApplication object a delegate that handles applicationDidBecomeActive:, applicationDidResignActive:, applicationDidHide:, and applicationDidUnhide:. Thanks.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Multiple Key Presses - Cocoa Events | JordanReed | 2 | 2,879 |
Jun 23, 2012 07:41 AM Last Post: JordanReed |
|
| Detecting window focus events | Coyote | 2 | 2,986 |
Oct 23, 2009 03:01 PM Last Post: Coyote |
|
| No window focus in Carbon app on 10.5 | withnail | 3 | 3,424 |
Jan 9, 2008 02:25 PM Last Post: OneSadCookie |
|
| Newbie Cocoa query - setTitle: at window init | sealfin | 3 | 4,505 |
Nov 14, 2005 10:32 AM Last Post: akb825 |
|
| Cocoa: Mouse location while dragging window | Fenris | 4 | 4,483 |
Jul 14, 2005 04:46 PM Last Post: Fenris |
|

