]> gitweb.factorcode.org Git - factor.git/commitdiff
editors.ui: Make the editors ui its own thing.
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 12 Jul 2018 02:52:17 +0000 (21:52 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 12 Jul 2018 02:52:17 +0000 (21:52 -0500)
basis/editors/ui/ui.factor [new file with mode: 0644]

diff --git a/basis/editors/ui/ui.factor b/basis/editors/ui/ui.factor
new file mode 100644 (file)
index 0000000..b69a179
--- /dev/null
@@ -0,0 +1,16 @@
+! Copyright (C) 2018 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors editors fry kernel sequences ui ui.gadgets
+ui.gadgets.borders ui.gadgets.buttons ui.gadgets.packs
+ui.gadgets.scrollers ui.tools.listener vocabs.loader ;
+IN: editors.ui
+
+: <reload-editor-button> ( editor -- button )
+    dup '[ drop [ _ reload ] \ run call-listener ] <border-button> ;
+
+: <editor-reloader> ( -- gadget )
+    <filled-pile> { 2 2 } >>gap available-editors
+    [ <reload-editor-button> add-gadget ] each ;
+
+MAIN-WINDOW: editor-window { { title "Editors" } }
+    <editor-reloader> { 2 2 } <border> <scroller> >>gadgets ;