Search code examples
c#xcodecocoamonomac

Many NSTabViewItems in a Single NSTabView


I have an application where the tabs are draw it dynamically depending of the numbers of items of a configuration file (i know, is not the best idea, but is a requeriment of a client). The problem is that the tab can't fit in the NSTabView, they are truncated. I dont know if there are an option for many tabs like in Windows in the NSTabView?

enter image description here


Solution

  • It should be possible. I know you tagged it c#, but here is a Objective-c way of doing it..

    I imagine a NSArray holding the tabs and then add and remove the array objects as tabs as you click the arrows.

    Take a look at https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSTabView_Class/Reference/Reference.html

    Look at:

    – addTabViewItem:
    – insertTabViewItem:atIndex:
    – removeTabViewItem: