0

I'd like a NSView to resize (larger and smaller) based on its currently viewed sub view. This is seen most often in UserDefaults but I would like it for a Modal Window.

I'm using a NSTabView inside the Window with 4 tabs. Each tab have quite different size requirements; and I'm hoping to avoid a lot of ugly empty space.

Is that a simple "Resize to fit content" button or something hand-baked.

I do see some similar questions, for example but none tackling NSTabView.

Community
  • 1
  • 1
Gabe Rainbow
  • 3,658
  • 4
  • 32
  • 42

1 Answers1

0

I wrote a loop that loops through all the subviews and finds the frame with the largest CGRectGetMaxY(). Then i add a padding and resize the window to height. It works really well.

atomkirk
  • 3,701
  • 27
  • 30