是否可以访问NSPopover窗口来设置级别? [英] Getting access to NSPopover window to set level?

查看:103
本文介绍了是否可以访问NSPopover窗口来设置级别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当弹出窗口显示时,我很好奇是否可以在弹出窗口的窗口上设置基础设置,例如窗口级别.在我的测试中,弹出窗口似乎是一个窗口,但是它们不响应普通的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?

推荐答案

NSPopoverNSObject的子类,而不是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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆