我如何用 Cocoa 创建一个透明且非矩形的 NSWindow?

发布于 2024-09-16 05:02:40 字数 161 浏览 2 评论 0原文

我想为我的 Cocoa 应用程序创建一个 Windows 风格的错误弹出窗口,如下所示 alt text

有没有教程如何执行此操作?或者有人可以至少给我一些我需要检查的 API 函数的名称吗?

I want to create a windows style error popup for my Cocoa application like this one
alt text

Is there any tutorial how to do this? Or can somebody give me at least the names of a few API functions that i need to check out.

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

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

发布评论

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

评论(3

北方。的韩爷 2024-09-23 05:02:40

苹果有一个例子: 圆形透明窗口< /a>

Apple has an example: Round Transparent Window

难以启齿的温柔 2024-09-23 05:02:40

看一下 MAAttachedWindow。您可以配置其背景和边框以匹配。

Take a look at MAAttachedWindow. You can configure its background and border to match.

百思不得你姐 2024-09-23 05:02:40

从 10.7 开始,您可以使用 NSPopover 来完成此操作。

我不确定是否可以将其设置为透明,但默认外观与弹出窗口在 Mac 上的预期外观一致。

As of 10.7, you can do this with NSPopover.

I'm not sure whether you can make one transparent, but the default appearance is consistent with how popovers are expected to look on the Mac.

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