cocoanswindownswindowcontrollernsrespondernscontrol

All controls disabled in title-less window


In my app I've got a secondary NSWindow that's created from .xib in my NSWindowController in my initWithWindowNibName: method. The window is a plain NSWindow with the title bar switched off.

After creating the window it's shown using makeKeyAndOrderFront: -
and all controls are disabled (text field, combo box).

I have (more than..) triple checked all flags in the window and the view hierarchy of the controls: everything is enabled, allowing editing and not refusing to be first responder.

Totally clueless. Any ideas?

Update #1:
I appears the problem is related to the window not having a title bar. When the title bar is switched on the window - and the controls in the window - behave as expected.


Solution

  • As pointed out by Ken the framework will automatically refuse becoming a key window if the window title is switched off:

    Attempts to make the window the key window are abandoned if this method returns NO. The NSWindow implementation returns YES if the window has a title bar or a resize bar, or NO otherwise.

    A simple subclass did the trick.