Calculating NSOutlineView cell indentation

Christiaan Hofman <[email protected]> Wed, 15 Feb 2012 13:41:15 +0100
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
Does anybody know how to calculate the full indentation used by =
NSOutlineView in its cells at various leveles? And how to influence it?

According to the SL release notes this calculation is not simply (1 + =
level) * indentationPerLevel, as it was until 10.5. Rather it is some =
width for the disclosure triangle plus some indentation based on the =
level. First of all, do I understand that this is something like =
indentationForLevel0 + level * indentationPerLevel? Or are only the =
cells at level 0 indented differently from 10.5? Moreover, I have no =
idea how to get this indentationForLevel0 part, is there any way to =
figure that our using the API?

Apart from that, I would also like to customize the indentation. What I =
really like is NO extra indentation for higher levels, but I do want to =
get the disclosure triangle. However, when indentationPerLevel is 0, =
there is no disclosure triangle as well. So is there a way to change =
this? I have tried lying about levelForItem:/levelForRow: by subclassing =
and always returning 0, but that did not do anything.

thanks,
Christiaan