是否可以访问NSPopover窗口来设置级别? [英] Getting access to NSPopover window to set level?
问题描述
当弹出窗口显示时,我很好奇是否可以在弹出窗口的窗口上设置基础设置,例如窗口级别.在我的测试中,弹出窗口似乎是一个窗口,但是它们不响应普通的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窗口来设置级别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!