Paste: Call from <border-button>
Author: | tgunr |
Mode: | factor |
Date: | Fri, 1 Jan 2021 20:27:05 |
Plain Text |
USING: accessors assocs io kernel namespaces sequences splitting
ui ui.gadgets ui.gadgets.borders ui.gadgets.buttons
ui.gadgets.labels ui.gadgets.packs ui.gadgets.scrollers
ui.tools.listener vocabs vocabs.loader ;
IN: theme-edit
SYMBOL: all-themes
: get-themes ( -- seq )
"ui.theme" >vocab-link all-themes set
all-themes get words>> keys
[ "-" split dup length 2 =
[ last "theme" = ]
[ drop f ]
if
] filter
;
: edit-theme ( x -- )
drop "HERE" print
;
: <run-theme-button> ( theme-name -- button )
dup '[ [ _ edit-theme ] ] <border-button> ;
: <theme-runner> ( -- gadget )
<filled-pile> { 2 2 } >>gap
"Select theme" <label> add-gadget
"pmn-theme" <run-theme-button> add-gadget ;
MAIN-WINDOW: themes { { title "Themes" } }
<theme-runner> { 2 2 } <border> <scroller> >>gadgets ;
New Annotation