Interface Builder

Hypernate

McGeek
In the Interface Builder, how do I get a window with tabs to change size according to the size of the tab, like in the System Prefs (I.E I have a tab with very little stuff, and then a tab with LOTS, how tdo i get the window to scale according to the size of the stuff in the tab?
 
I just realised It DOESN"T do that in SysPrefs... that's only for the panels... can I do it with tabs though?
 
Sure. Just implement -tabView:willSelectTabViewItem: in your NSTabView's delegate, and have it resize the window appropriately.
 
Do you mean "tabViewwillSelectTabViewItem:" (without qutes of course)

And is so, how to I make it change the size of th ewindow according to the size of each tab?
 
Go read the docs again. It's -tabView:willSelectTabViewItem:. This way it tells you which NSTabView and which NSTabViewItem it is talking about.

Each NSTabViewItem has an associated view which holds its contents. You can get this view with [tabviewitem view], and get its size with [[tabviewitem view] frame].size. From there, you just need to do some math with the distances from the edges of the window to the edges of the NSTabView's content.
 
Back
Top