-1

I'm using NSOutlineView for the first time and have 3 columns. What I want is for the first column to expand to fill the available space, leaving columns 2 and 3 aligned to the right margin of the NSOutlineView.

I have managed to get the last column to resize by using: -

outlineView.sizeLastColumnToFit()

but so far failed to find out how to size the first column.

Can this be done?

PhilC
  • 123
  • 8
  • Take a look at the settings in IB. Did you try setting Column Resizing of the outline view to First Column Only? Did you try different settings of Resizing of the table columns? – Willeke Apr 20 '19 at 10:47
  • Yes tried First Column only and it made no difference. Did try setting the "Autosizes with Table" setting for the column. Now this seems to work, if you first manually resize the Outline to a smaller size (in my case by dragging a splitter bar). Once you have done this, the column resizes with the table. If you move the splitter bar to make the table bigger, then it doesn't resize. Seems to need a "shrink" action first. I tried reducing the column width in code first (once the view is loaded) but that made no difference. So it nearly works.... – PhilC Apr 20 '19 at 13:13
  • Make sure the columns fit the ouline view in IB so the most right column sticks to the right side of the ouline view. – Willeke Apr 21 '19 at 08:20

1 Answers1

0

Make sure the columns fit the ouline view in IB so the most right column sticks to the right side of the ouline view. – Willeke

Willeke solved this one for me; aligning the last column to the right edge allowed the columns to resize correctly

PhilC
  • 123
  • 8