I have an NSPopover which opens from an NSStatusItem in the menu-bar app.
This NSPopover (transient) can be torn off, and then it looks like a floating window/panel. The popover displays a view which is defined and attached to the popover in a normal .xib file
I can obtain the underlying window object from the NSPopover like this:
NSWindow *statusWindow = [self.statusIconView window]; // hopefully the detached window?
where self.statusIconView
is the view attached to the Popover controller.
The statusWindow looks like a normal NSWindow – but any attempt to change its attributes (I’m trying to make it resizable for instance) is ignored.
I tried to inspect it in the debugger – and found out that its class is special:
NSPopoeverWindow : NSPanel : NSWindow
meaning – it is a special subclass of NSPanel which in turn is a subclass of NSWindow. I suspect this special class overrides and ignores much of the NSWindow functionality.
Now my question:
Is there a way to force it to “behave” the way I want?
- I want it resizable.
- I want it to become “key” — the text fields inside the view can’t be edited, refuse keyboard commands (for copy/paste/select-all)
I did NOT create this window, and I did not anywhere in my code determined its class. It’s NSPopover (or maybe NSPopoverController) who do this.
my code is Obj-C but I don’t think that matters here.
Any idea will be greatly appreciated.