added gui for file-trees
parent
7d020d8f2f
commit
0ca6a6c63f
|
@ -1,10 +1,10 @@
|
|||
USING: accessors delegate delegate.protocols io.pathnames
|
||||
kernel locals namespaces sequences vectors
|
||||
tools.annotations prettyprint ;
|
||||
USING: accessors arrays delegate delegate.protocols
|
||||
io.pathnames kernel locals namespaces prettyprint sequences
|
||||
ui.frp vectors ;
|
||||
IN: file-trees
|
||||
|
||||
TUPLE: tree node children ;
|
||||
CONSULT: sequence-protocol tree children>> [ node>> ] map ;
|
||||
CONSULT: sequence-protocol tree children>> ;
|
||||
|
||||
: <tree> ( start -- tree ) V{ } clone
|
||||
[ tree boa dup children>> ] [ ".." swap tree boa ] bi swap push ;
|
||||
|
@ -20,4 +20,9 @@ DEFER: (tree-insert)
|
|||
path-rest [ path-head tree-insert ] unless-empty
|
||||
] if* ;
|
||||
: create-tree ( file-list -- tree ) [ path-components ] map
|
||||
t <tree> [ [ tree-insert ] curry each ] keep ;
|
||||
t <tree> [ [ tree-insert ] curry each ] keep ;
|
||||
|
||||
: <dir-table> ( tree-model -- table )
|
||||
<frp-list*> [ node>> 1array ] >>quot
|
||||
[ selected-value>> <switch> ]
|
||||
[ swap >>model ] bi ;
|
Loading…
Reference in New Issue