views:

8

answers:

0

Hi, I'll try to make this question as clear as possible.

I have an NSOutlineView with four columns. The first three columns use a CustomCell class that I wrote where I just override drawInteriorWithFrame to make some custom drawing. The fourth column uses another custom class called TimelineCell where I do some more advanced drawing. Also there I only override drawInteriorWithFrame. The resize policy of the view is set to "Last column", so when I resize it, only the last column gets resized.

Everything works fine when I resize the view or the window, but something very weird happens when I expand and then collapse a row that has children.

When I click on the small triangle to expand, the FIRST column resizes itself to accommodate the indented child. This makes the LAST column (TimelineCell) shrink by 16 pixels. This behavior would be ok if the following problem wouldn't happen. If I click the triangle again to collapse the row, the FIRST column shrinks back to the original size, but the LAST column only shifts to the left by 16 pixel and doesn't realize that it has 16 pixels more in width. Even weirder, the outlineview creates another column on the fly 16 pixels wide to fill the gap on the right.

In the DragNDropOutlineView example by Apple this doens't happen at all. Actually, the first column never resizes itself even if the indentation level is high and the text doesn't fit anymore. In my outlineview, it tries to keep always enough space in the first column. I don't really need this behavior.

I compared my outlineview to the example's one in IB and I really couldn't find any difference in the settings.

Any idea of what it's happening? Do I have to override other methods?

Thanks, Marco