您如何重新排序可可豆中其他所有窗口的顶部? [英] How do you re-order a window to be on top of all others in cocoa?

查看:91
本文介绍了您如何重新排序可可豆中其他所有窗口的顶部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的应用程序在需要显示重要信息时成为OSX桌面上的顶级窗口.您将如何在可可中这样做?

I want my application to become the top-level window on the OSX desktop when it needs to display important information. How would you go about doing this in cocoa?

推荐答案

您是说要劫持用户的屏幕?您不仅可以在NSApplication上调用requestUserAttention:吗?如果您确实必须劫持屏幕,请查看NSWindow中的setLevel:.请记住,除非有非常好的理由,否则像我这样的用户都会在您劫持屏幕后立即删除您的应用程序.每当您考虑进行此类操作时,请查看 http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGIntro/XHIGIntro.html ,然后先确定这是否是正确的做法.

You mean you want to hijack the user's screen? Can you not just call requestUserAttention: on NSApplication? If you really must hijack the screen then look into setLevel: in NSWindow. Just keep in mind that any user like myself is going to delete your application as soon as you hijack the screen unless there is a very good reason to do so. Whenever you are thinking about doing things like this look at http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGIntro/XHIGIntro.html first, then decide if it is the right course of action.

这篇关于您如何重新排序可可豆中其他所有窗口的顶部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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