5

I have a NSSplitView. On the left pane of that split view I have an NSTableView and a custom view created programmatically. I'm using a delegate to make sure my two panes don't resize at the same time.

I add my custom view thus:

BWAnchoredButtonBar *anchoredButtonBar = [[[BWAnchoredButtonBar alloc] initWithFrame:[leftPane bounds]] autorelease];
[leftPane addSubview:anchoredButtonBar];

And it seems to work ok. When I run my application everything works fine. Now, my problem is that when I resize the split view pane, the custom view does not resize with it leaving an ugly white space between it and the divider of the NSSplitView.

I guess what I want to ask is, how can I programmatically set the springs and struts that IB sets visually?

Also, I can't use IB because Xcode 4 does not support IB plugins.

ruipacheco
  • 15,025
  • 19
  • 82
  • 138

1 Answers1

9

-[NSView setAutoresizingMask:] is how you set springs and struts programmatically.

Dave DeLong
  • 242,470
  • 58
  • 448
  • 498