当弹出窗口显示时,我很好奇是否可以在弹出窗口的窗口上设置基础设置,例如窗口级别.在我的测试中,弹出窗口似乎是一个窗口,但是它们不响应普通的NSWindow选择器,例如setLevel:.
When a popover shows, I'm curious whether it's possible to set the underlying settings on the popover's window, such as the window level. In my testing, popovers seem to be a window, but they doesn't respond to normal NSWindow selectors, such as setLevel:.
是否可以在NSPopover上设置窗口级别?
Is it possible to set the window level on a NSPopover?
推荐答案NSPopover是NSObject的子类,而不是NSWindow的子类,因此不正式支持设置窗口级别.
NSPopover is a subclass of NSObject, not NSWindow, so setting the window level is not officially supported.
您可以尝试像这样获取窗口:
You could try getting the window like this:
NSWindow* popoverWindow = yourPopover.contentViewController.view.window;我不知道您是否可以成功设置水平.
I have no idea whether you can then successfully set the level though.
更多推荐
是否可以访问NSPopover窗口来设置级别?
发布评论