]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/ui/ui.factor
editors: allow them to be loaded in the load-all image
[factor.git] / basis / editors / ui / ui.factor
1 ! Copyright (C) 2018 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors editors kernel namespaces sequences ui
4 ui.gadgets ui.gadgets.borders ui.gadgets.buttons
5 ui.gadgets.packs ui.gadgets.scrollers ui.tools.listener
6 vocabs.loader ;
7 IN: editors.ui
8
9 : <reload-editor-button> ( editor -- button )
10     dup '[
11         drop
12         [ f editor-class set-global _ reload ]
13         \ run call-listener
14     ] <border-button> ;
15
16 : <editor-reloader> ( -- gadget )
17     <filled-pile> { 2 2 } >>gap available-editors
18     [ <reload-editor-button> add-gadget ] each ;
19
20 MAIN-WINDOW: editor-window { { title "Editors" } }
21     <editor-reloader> { 2 2 } <border> <scroller> >>gadgets ;