I have an NIB-based NSPanel, style Utility Panel, that I'm making a child window of my NSDocument window. I'd like it to behave like a drawer, in that it appears like part of the window, with controls drawn in their active-window state whenever the document window is main. I'm also planning on customizing the frame, close & minimize buttons.
The panel has becomesKeyOnlyIfNeeded & excludedFromWindowsMenu set to YES, and its subclassed to return YES from canBecomeKeyWindow.
The panel's NIB contains a NSSegmentedControl and a view into which I add a view from another NIB. I'm finding that the segmented control is being drawn in its window-inactive state unless the panel is clicked on to become key.
I tried a trick from OmniGroup's OIInspectorWindow & cocoadev.com's NSWindow page, implementing an _hasActiveControls method that returns YES, but that seemed to have no effect. I then tried then overriding isMainWindow to return YES whenever the parent window is the main window (plus observing the window's state change notification & calling -display). I was hoping that this would fool the control & window frame to draw in the active state. On 10.7 (Lion) it turns out that the control does indeed draw active as I wanted, though the window frame isn't. On 10.8 (Mountian Lion), not even that, the segmented control is still inactive when the window isn't key.
I can live with my trick not affecting the window frame & close button, since I plan on customizing those anyway. Does anyone know either a) why my trick doesn't work on 10.8 and how I can get it to work, or b) another way to ensure my panel's control is always active when its parent window is main.