--- /tmp/file-explorer.factor 2013-12-01 17:32:01.808115022 +0100 +++ work/file-explorer/file-explorer.factor 2013-12-01 17:37:16.212103551 +0100 @@ -4,6 +4,7 @@ math.parser models namespaces present prettyprint sequences splitting ui ui.commands ui.gadgets ui.gadgets.buttons ui.gadgets.frames ui.gadgets.grids ui.gadgets.packs +locals ui.gadgets.scrollers ui.gadgets.tables ui.gestures ; ! windows.kernel32 ; @@ -84,21 +85,22 @@ { 500 400 } >>pref-dim [ row-hook ] >>hook ; -: select-action ( button -- ) - drop ; +: select-action ( button file-explorer -- ) + nip row-action ; : cancel-action ( button -- ) close-window ; -: fe-buttons ( -- gadget ) +:: fe-buttons ( file-explorer -- gadget ) - "Select" [ select-action ] add-gadget + "Select" [ file-explorer select-action ] add-gadget "Cancel" [ cancel-action ] add-gadget ; : file-explorer ( -- ) [ 1 2 { 0 0 } >>filled-cell - { 0 0 } grid-add - fe-buttons { 0 1 } grid-add + + [ { 0 0 } grid-add ] + [ fe-buttons { 0 1 } grid-add ] bi "File Explorer" open-window ] with-ui ; MAIN: file-explorer