Why does a displayblock affect the arguments used for accessing the As I don't want to see the FileReference printString, but thechildren 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. 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 May examples from GLMBasicExamples are using #display: , thats why I tried this first. What is the intention to use the display block for accessing the children? _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi Nicolai, All glamour browser open on a model object. The display block is used to extract from that model object the actual object that would be displayed. In the case of a tree presentation the display block should return the initial roots of three. So you can open the browser on any object, and then the display block would get that object as a parameter and return a list of objects that would be used as the roots of the tree. For example, you could write 'browser openOn: FileSystem disk' and then have a display block that extracts the working directory from the file system (display: [ :filesystem | filesystem workingDirectory ];) The whole example would look like: browser := GLMTabulator new. browser column: #tree; column: #text. browser transmit to: #tree; andShow: [ :a | a tree title: 'FS'; display: [ :filesystem | filesystem workingDirectory ]; format: [ :item | item basename ]; children: [ :item | item isDirectory ifFalse: [ #() ] ifTrue: [ item children ] ] ]. browser openOn: FileSystem disk Cheers, Andrei On Tue, Feb 10, 2015 at 5:02 PM, Nicolai Hess <[hidden email]> wrote:
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
2015-02-10 17:38 GMT+01:00 Andrei Chis <[hidden email]>:
Thank you for the explanation Andrei, I thought the display block is used to convert the data to a displayable representation. But if it is used to extract the data, then the described behavior makes sense of course. nicolai
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi, display: is a transformation used to convert the input object into an object that will act as a model for the presentation. Cheers, Doru On Tue, Feb 10, 2015 at 7:55 PM, Nicolai Hess <[hidden email]> wrote:
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Free forum by Nabble | Edit this page |