I have a multi window Cocoa app, implemented using the techniques described in an answer to a previous question.
All works fine, however windows opened after the initial window come up and are shown front, but their state is not active (everything greyed). I have to explicitly click inside their frame to make them the active window.
My checks so far:
- I've tried
makeKeyAndOrderFront:
but that doesn't make any difference. - The file owner in the NIB is set to the corresponding controller class of the window.
- I can see in the Debugger that the instance of each controller is actually the owner of the corresponding window.
- The solution suggested by NSThread does not make the the window key window.
- The method
canBecomeKeyWindow
returnsNO
although the window is an instance of NSWindow. - The window has a title bar and is resizable.
What do I need to do to show subsequent windows in an active state?
EDIT:
I subclassed NSWindow
with SecondaryWindow
and override canBecomeKeyWindow
to return YES
. I changed to XIB to use the newly created subclass of NSWindow
. Stepped through the code with the debugger, but still the window does not become the key window.