Or you can use displayBlock: (and root: and children:) directly on the
TreeModel.
tree := self newTree.
tree
roots: { root1 root2 };
displayBlock: [ :node | node label ];
childrenBlock: [ :node | node children ];
iconBlock: [ :node | node icon ].
I'm not sure if direct creation of TreeColumnModel/TreeNodeModel is advised
considering TreeModel is trying to hide it.
Peter
On Thu, Jul 2, 2015 at 1:33 PM, Christophe Demarey <
[email protected]> wrote:
>
> Le 30 juin 2015 à 16:01, Christophe Demarey a écrit :
>
> > Hi,
> >
> > I have a TreeModel with different kinds of TreeNodeModel and I would
> like to get a customizable display string depending on the node type.
> > It looks like it is not possible to dispatch on nodes in a display block
> because it only takes the item (node content) and the tree as parameter.
> > It is strange as I expect that to be a standard feature. Do I miss
> something?
>
> I found a workaround and it looks like a missing feature in Spec TreeModel.
> You can customize the display by settings columns on the tree like this:
>
> self newTree
> columns: { TreeColumnModel new
> displayBlock: [:node | node label ] };