Detecting window focus events
I have a window (in Cocoa) and I need to be able to tell when it is hidden/shown, is minimized/unminimized, and looses/gains focus. Strangely, I can't seem to find any documentation that says how to do this.
You can observe the relevant notifications (listed in the section at the bottom of the NSWindow docs), or you can subclass the window and override the relevant methods (e.g. becomeKeyWindow).
Thank you. And I've just discovered the wonderful world of window delegates.
What's the difference though between a window becoming the key window and a window becoming the main window?
What's the difference though between a window becoming the key window and a window becoming the main window?
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| detecting 2 touches, is order of touch significant? | sefiroths | 4 | 9,336 |
Sep 30, 2011 07:29 AM Last Post: @iOS_blog |
|
| Detecting OS and Mac version | xiotex | 2 | 2,718 |
Nov 14, 2009 03:02 PM Last Post: xiotex |
|
| Window focus events in Cocoa | Jar445 | 2 | 4,382 |
Jan 18, 2009 06:02 PM Last Post: Jar445 |
|
| No window focus in Carbon app on 10.5 | withnail | 3 | 3,428 |
Jan 9, 2008 02:25 PM Last Post: OneSadCookie |
|
| Mouse events for an openGL window | majestik666 | 5 | 6,809 |
Jul 5, 2005 06:15 PM Last Post: majestik666 |
|

