0

I have a NSSplitView, with three views. I wan't the first view (from the left) to be 100.0 wide and I want the second (from the left) to be 250.0 wide. I also want the width of those two views to remain fixed.

So, in applicationDidFinishLoading is set the position.

[mainSplitView setPosition:100.0 ofDividerAtIndex:0];
[mainSplitView setPosition:350.0 ofDividerAtIndex:1];

I also set the delegate:

[mainSplitView setDelegate:self];

Lastly, I implemented the following part of the protocol:

- (NSRect)splitView:(NSSplitView *)splitView effectiveRect:(NSRect)proposedEffectiveRect forDrawnRect:(NSRect)drawnRect ofDividerAtIndex:(NSInteger)dividerIndex
{
    return NSZeroRect;
}

However, when I resize the entire window, the sizes of the all views change. I only want the third view to change it's size. What do I need to to prevent this behavior?

No, I do not want to use a third party library.

v0idless
  • 948
  • 2
  • 11
  • 24

1 Answers1

0

I know this sounds completely obvious, but have you tried good old struts and springs? Remove the springs and add struts to the top and left hand sides, and they'll stay in the upper left corner and not resize.

Metabble
  • 11,773
  • 1
  • 16
  • 29