Why does a displayblock affect the arguments used for accessing the
children of the nodes?
The following code creates a TreePresentation from the current working Directory:
browser := GLMTabulator new.
browser
column: #tree;
column: #text.
browser transmit
to: #tree;
andShow: [ :a |
a tree
title: 'FS';
"display: [ :item | item basename ];"
children: [ :item |
item isDirectory
ifFalse: [ #() ]
ifTrue: [ item children ] ] ].
browser openOn: FileSystem disk workingDirectory.
As I don't want to see the FileReference printString, but the
name of the File, the first thing I tried is a displayblock like
the commented line above.
But after this change the children block does not work anymore.
The item it calls #isDirectory on, is not the FileSystem entry but the
name returned by the display block.
#format: instead of #display: works:
browser := GLMTabulator new.
browser
column: #tree;
column: #text.
browser transmit
to: #tree;
andShow: [ :a |
a tree
title: 'FS';
format: [ :item | item basename ];
children: [ :item |
item isDirectory
ifFalse: [ #() ]
ifTrue: [ item children ] ] ].
browser openOn: FileSystem disk workingDirectory
I tried this first. What is the intention to use
the display block for accessing the children?