If I add a number of NSTabViewItems to an NSTabViewController, the tab view item buttons are sized according to the length of the label text. With different texts for each label this can result in NSTabViewItem buttons that have vastly different sizes.
Is there a way to set the button sizes/widths to a specific size in IB? Can it be done dynamically in code?
I don't think this can be done in Interface Builder, but you should be able to subclass NSTabViewItem and override
- (NSSize)sizeOfLabel:(BOOL)computeMin
in order to return desired value. More info here.For instance, if you want all NSTabViewItem of same 100 pt width:
and, of course, you'll need to set your NSTabView's items to be instance of MyTabViewItem (either in IB or when dynamically adding them in your code).