隐藏和显示 HUD 窗口 - 可可?

发布于 2024-08-04 09:52:58 字数 94 浏览 3 评论 0原文

我有一个 HUD 窗口,上面有一些标签,我希望当用户按下按钮时显示它。我知道这很简单,但除非重新启动程序,否则我无法再次显示它。

此致,

凯文

I have a HUD window that has some labels on it, and I want this to show when the user presses a button. I know this is simple, but I can't get it to show again unless I restart my program.

Sincerely,

Kevin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无悔心 2024-08-11 09:52:58

隐藏 hudWindow

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    [hudWindow orderOut:nil]; // to hide it
}

然后按下按钮:

- (IBAction)showWindow:(id)sender {
    [hudWindow makeKeyAndOrderFront:nil]; // to show it
}

To hide hudWindow:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    [hudWindow orderOut:nil]; // to hide it
}

Then on button press:

- (IBAction)showWindow:(id)sender {
    [hudWindow makeKeyAndOrderFront:nil]; // to show it
}
少年亿悲伤 2024-08-11 09:52:58

在 IB 中,转到窗口的属性检查器并确保未选中“关闭时释放”。

In IB, go to the window's attributes inspector and make sure that "Released when closed" isn't checked.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文