管理全屏视图并支持弹出对话框 (Cocoa/OSX)
我正在开发一个 Cocoa 应用程序,它由 5 个不同形状和大小的视图组成,其中一些视图是 NSOpenGLViews。我需要具有任何这些视图的功能,以便能够接管整个窗口并进入某种全屏模式。我最初尝试使用 EnterFullScreenMode:withOptions: 方法执行此操作,但当我尝试打开对话框窗口时遇到了麻烦(这会导致崩溃)。所以看来我需要稍微缩减我的方法,因为没有这些弹出对话框我就无法生活。
我的新策略是拉伸即将进入全屏模式的视图,使其占据屏幕的整个视图,然后进入信息亭模式。我想知道是否有人尝试过这种类型的方法来制作全屏视图,以及他们是否可以提供有关此类实施的最佳实践的任何建议。
我主要关心的是,当我离开全屏模式时,我需要保留窗口的状态,所以我想知道隐藏其他视图的最佳方法是什么。我是否可以使其他视图不可见,然后拉伸全屏视图以接管该窗口,或者将全屏视图放入新窗口中然后拉伸此新窗口会更好吗?我的第一个倾向是最好将全屏视图保留在其原始窗口中,因为这似乎会减少对事件处理的干扰。
I am working on a Cocoa app that consists of 5 views of varying shapes and sizes, some of these views are NSOpenGLViews. I need to have functionality for any of these views to be able to take over the whole window and go into some sort of full screen mode. I originally tried doing this with the method enterFullScreenMode:withOptions: but I ran into trouble when I would try and bring up a dialog window (this would result in a crash). So it seems that I need to scale back my approach a little because I cannot live without these popup dialogs.
My new strategy is to stretch the view that is going into full screen mode so that it takes over the whole view of the screen and then enter into kiosk mode. I was wondering if anyone had tried this type of approach to make a full screen view and if they could offer any advice about best practices for this type of implementation.
My main concern is that I need to preserve the state of the window when I leave full screen mode so I am wondering what would be the best way to hide the other views. Could I just make the other views invisible and then stretch my full screen view to take over the window or would it be better to put the full screen view into a new window and then stretch this new window? My first inclination is that it would be best to keep the full screen view in its original window because it seems this would interfere with event handling less.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论