以可编程方式打开和关闭窗口 [英] opening and closing a window programmatically in cocoa
本文介绍了以可编程方式打开和关闭窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的项目中有两个nib。我一直在挖网络,以弄清楚如何使一个按钮关闭或隐藏的笔尖,按钮是打开另一个。另一个笔尖会有一个按钮,做同样的事情,但反之亦然。
I have two nibs in my project. I have been digging around the interwebs to figure out how to make a button close or hide the nib that the button is on and open another one. The other nib would have a button that does the same thing but in vice versa.
我没有最初的想法从这里开始。如果有人只是做一个样例类和方法,我可能会有一些工作。
I don't have the faintest idea where to start with this. IF someone could just make a sample class and methods for this i might have something to work with.
推荐答案
[window close];
隐藏窗口(不释放)
[window orderOut:self];
将窗口移到其在屏幕列表中的级别(=显示窗口)
[window orderFront:self];
查看
- NSWindow Class Reference
- Window Programming Guide
这篇关于以可编程方式打开和关闭窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文