向NSTabviewitem添加关闭按钮 [英] Add a close button to NSTabviewitem
问题描述
我有一个应用程序有一个标签视图,当用户在菜单中点击例如客户端数据时,我生成一个标签程序。现在我想要子类化选项卡视图为每个NSTabviewitem添加一个关闭按钮。如果你没有答案,你可以帮助文档或示例代码
I have a application with a tab view when the user clicks in the menu for example "client data" I generate a tab programmaticaly. Now I want to subclass the tab view to add a close button for each NSTabviewitem. If you don't have an answer you could help with documentation or sample code
推荐答案
我知道这个问题是古老的, ..
I know this question is ancient, but...
我花了一些时间试图添加按钮到NSTabViewItems与一个自定义子类,并且据我所知,这是不可能的。 NSTabViewItem根本不能定制到足以做这项工作。
I spent some time trying to add buttons to NSTabViewItems with a custom subclass, and as far as I can tell it's not really possible. NSTabViewItem simply isn't customizable enough to do the job.
我的建议是看看 chromium-tabs 或者可能 PSMTabBarControl ;它们具有与标准NSTabViewItems不同的外观,但为图标和关闭按钮提供开箱即用功能。
My suggestion is to take a look at chromium-tabs or perhaps PSMTabBarControl; they have a different appearance than standard NSTabViewItems, but provide out-of-the-box functionality for icons and close buttons.
这篇关于向NSTabviewitem添加关闭按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!