使应用程序弹出全屏应用程序(Making an application pop up over a fullscreen app)

编程入门 行业动态 更新时间:2024-10-24 12:24:36
使应用程序弹出全屏应用程序(Making an application pop up over a fullscreen app)

我正在试图找出如何使应用程序弹出窗口前面和所有其他窗口。 这可能是一个糟糕的解释,所以基本上我希望应用程序在快捷键被击中时表现得像水银或阿尔弗雷德。

我在NSWindow找不到任何我想要的东西......我错过了什么吗?

I'm trying to figure out how to make an application popup front and above all other windows. That may have been a poor explanation so basically I want the app to act like quicksilver or alfred when a shortcut key is hit.

I couldn't find anything that looked like I wanted in NSWindow... Did I miss something?

最满意答案

更具体地说,类似于:

[newWindow setLevel:NSFloatingWindowLevel]; [newWindow setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];

...将工作; 第二行可能是您想要的附加行为,允许窗口显示在每个空间中而不仅仅是隔离到一个空间。

另请注意,就窗口级别而言, NSFloatingWindowLevel之上的任何内容NSFloatingWindowLevel可以工作; 为清晰起见,最好使用命名常量。

Even more specifically, something like:

[newWindow setLevel:NSFloatingWindowLevel]; [newWindow setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];

...will work; the second line is probably additional behavior that you would want, allowing the window to be shown in every space and not just isolated to one.

Also note that in terms of window levels, anything above NSFloatingWindowLevel will work; it is better to used a named constant for clarity.

更多推荐

本文发布于:2023-07-26 15:37:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1277424.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   弹出   全屏   Making   app

发布评论

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

>www.elefans.com

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