I successfully registered a hot key; its handler brings my app window to the front: [NSApp activateIgnoringOtherApps:YES]; (it is supposed to at least).
I have the expected behavior when my app window is in not in the front.
But it doesn’t work when I close the window (clicking the red x) or when I minimize it (clicking the yellow –).
I still see the log though so the handler is called.
Any ideas?
Thanks.
-L
I would set the window to have the following attributes in the nib:
The key things are, if you plan on having the window open and closed several times, to make sure “Release when closed” is unchecked. You may also want to uncheck “Visible at Launch” to make it more clear that you’ll handle the showing of the window yourself in code. (It’s the presence of this flag which is likely responsible for your window being shown at all, immediately when the nib is loaded).
To show the window in code, just do something like the following (assuming you have an IBOutlet for window):