是否可以访问NSPopover窗口来设置级别?

编程入门 行业动态 更新时间:2024-10-26 08:30:19
本文介绍了是否可以访问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?

推荐答案

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窗口来设置级别?

本文发布于:2023-11-08 11:41:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1569272.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:级别   窗口   NSPopover

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!