From cb4ca7cca410fcd9c3a76b633f47e5475e442024 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 11 Jul 2018 21:41:46 -0500 Subject: [PATCH] editors: Add a MAIN-WINDOW: to editors to easily reload editors. --- basis/editors/editors.factor | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/basis/editors/editors.factor b/basis/editors/editors.factor index 5efafdbb7e..741357a2a6 100644 --- a/basis/editors/editors.factor +++ b/basis/editors/editors.factor @@ -1,9 +1,11 @@ ! Copyright (C) 2005, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. 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 -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 ; IN: editors @@ -126,3 +128,13 @@ M: word edit-tests vocabulary>> edit-tests ; : edit-summary ( vocab -- ) dup vocab-summary-path vocab-append-path 1 edit-location ; + +: ( editor -- button ) + dup '[ drop [ _ reload ] \ run call-listener ] ; + +: ( -- gadget ) + { 2 2 } >>gap available-editors + [ add-gadget ] each ; + +MAIN-WINDOW: editor-window { { title "Editors" } } + { 2 2 } >>gadgets ;