From 4809a69d7fbecfc6677d34ca2fa7c9ebdc681f2c Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Mon, 14 Jul 2008 17:33:03 -0500 Subject: [PATCH] ui.tools.listener: rewrite --- extra/ui/tools/listener/listener.factor | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/extra/ui/tools/listener/listener.factor b/extra/ui/tools/listener/listener.factor index f6d9f54efd..c34061cf43 100755 --- a/extra/ui/tools/listener/listener.factor +++ b/extra/ui/tools/listener/listener.factor @@ -12,9 +12,9 @@ IN: ui.tools.listener TUPLE: listener-gadget < track input output stack ; -: listener-output, ( -- ) - g-> set-listener-gadget-output - "Output" 1 track, ; +: listener-output, ( listener -- listener ) + >>output + dup output>> "Output" 1 track-add* ; : listener-streams ( listener -- input output ) [ input>> ] [ output>> ] bi ; @@ -22,10 +22,12 @@ TUPLE: listener-gadget < track input output stack ; : ( listener -- gadget ) output>> ; -: listener-input, ( -- ) - g g-> set-listener-gadget-input +: listener-input, ( listener -- listener ) + dup >>input + dup input>> { 0 100 } - "Input" f track, ; + "Input" + f track-add* ; : welcome. ( -- ) "If this is your first time with Factor, please read the " print @@ -169,10 +171,11 @@ M: stack-display tool-scroller f swap set-listener-gadget-stack ; : ( -- gadget ) - { 0 1 } listener-gadget new-track + { 0 1 } listener-gadget new-track dup init-listener - [ listener-output, listener-input, ] make-gadget ; - + listener-output, + listener-input, ; + : listener-help ( -- ) "ui-listener" help-window ; \ listener-help H{ { +nullary+ t } } define-command