columns := { TreeColumnModel new
displayBlock: [:node | (self wrapItem: node content) ] } asValueHolder.
TreeModel>>#wrapItem: anItem
^ displayBlock value cull: anItem cull: self
As you can see, it is then impossible to get a reference to the node. You only get the node content and a reference to the tree itself.
Le 2 juil. 2015 � 14:01, Peter Uhn�k a �crit :
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