editors: Add a MAIN-WINDOW: to editors to easily reload editors.

vm-warnings
Doug Coleman 2018-07-11 21:41:46 -05:00
parent 7209d53c83
commit cb4ca7cca4
1 changed files with 14 additions and 2 deletions

View File

@ -1,9 +1,11 @@
! Copyright (C) 2005, 2009 Slava Pestov. ! Copyright (C) 2005, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs calendar continuations debugger USING: accessors assocs calendar continuations debugger
definitions io io.launcher io.pathnames kernel namespaces definitions fry io io.launcher io.pathnames kernel namespaces
prettyprint sequences source-files.errors splitting strings prettyprint sequences source-files.errors splitting strings
threads tools.crossref vocabs vocabs.files vocabs.hierarchy threads tools.crossref ui ui.gadgets ui.gadgets.borders
ui.gadgets.buttons ui.gadgets.packs ui.gadgets.scrollers
ui.tools.listener vocabs vocabs.files vocabs.hierarchy
vocabs.loader vocabs.metadata words ; vocabs.loader vocabs.metadata words ;
IN: editors IN: editors
@ -126,3 +128,13 @@ M: word edit-tests vocabulary>> edit-tests ;
: edit-summary ( vocab -- ) : edit-summary ( vocab -- )
dup vocab-summary-path vocab-append-path 1 edit-location ; dup vocab-summary-path vocab-append-path 1 edit-location ;
: <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 ;