Add a close button to NSTabviewitem

廉价感情. 提交于 2019-12-06 08:38:53

问题


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


回答1:


I know this question is ancient, but...

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.

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.



来源:https://stackoverflow.com/questions/5898951/add-a-close-button-to-nstabviewitem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!