创建 NSToolbar 样式按钮

发布于 2024-12-17 03:53:01 字数 168 浏览 4 评论 0原文

是否有一种斜角样式可以复制 NSToolbar 样式的按钮,例如在 Safari 的首选项窗口中用于在不同窗格之间切换?

我需要使用 NSButtons 在 NSView 中复制 NSToolbar。我知道我可能应该使用 NSTabView,但我想实现 xcode 左窗格的外观。这里的任何提示将不胜感激。

Is there a bevel style that can replicate NSToolbar style of buttons that are used, for instance, in the Safari's preferences window to switch between different panes?

I need to replicate NSToolbar in an NSView using NSButtons. I understand that I should probably be using NSTabView, but I'd like to implement the look of xcode's left pane. Any tips here would be appreciated greatly.

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

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

发布评论

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

评论(1

诗酒趁年少 2024-12-24 03:53:01

没有任何内置内容,您必须自己创建图像。然而,复制该行为很简单。

您可以简单地使用 NSButton 对象的单行 NSMatrix 。只需为按钮提供一个图像和一个备用图像(用于突出显示状态)并将矩阵模式设置为 NSRadioModeMatrix 即可。

There's nothing built-in, you'd have to create the images yourself. However, replicating the behaviour is straightforward.

You could simply use a single-row NSMatrix of NSButton objects. Just give the buttons an image and an alternate image (for the highlighted state) and set the matrix mode to NSRadioModeMatrix.

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