4

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

Javier Beltrán
  • 756
  • 5
  • 26

1 Answers1

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.

John Wells
  • 1,139
  • 1
  • 10
  • 27
  • In my quest to write an Xcode plugin, I have uncovered that Apple is somehow using a standard NSTabView coupled with a private view class they call a "DVTTabSwitcher" in Xcode. Their private view class inherits from only NSView... I'm not yet sure what the relationship is, but I'm guessing the switcher provides the functionality of editing tab titles and renaming them, perhaps? – ArtOfWarfare May 12 '13 at 14:15