takawiri: clean up part of the TOB display; further testing of Watchlist code

FossilOrigin-Name: 0ffd65402d802d4d960920eca098262e9ca31a98fa3203d2a334499f2481d178
This commit is contained in:
crc 2024-01-22 13:20:08 +00:00
parent 76ac1f0878
commit 76b2f277df

View file

@ -20,6 +20,9 @@ Setup the text output buffer dimensions.
Setup the local terminal dimensions. Setup the local terminal dimensions.
TODO: some systems may provide this in the environment. See if
this can be pulled in automatically if present?
~~~ ~~~
#105 'LT:W const #105 'LT:W const
#30 'LT:H const #30 'LT:H const
@ -33,6 +36,15 @@ Load depenencies from the library.
{ 'konilo 'termina 'tob } &library:load a:for-each { 'konilo 'termina 'tob } &library:load a:for-each
~~~ ~~~
# Configure UI Colors
~~~
:dss:label (-) fg:red ;
:dss:value (-) fg:cyan ;
:dss:sep (-) fg:blue ;
:dss:prompt (-) bg:blue fg:white ;
~~~
# Utilities # Utilities
I intend for takawiri to provide a variety of useful tools to I intend for takawiri to provide a variety of useful tools to
@ -56,39 +68,40 @@ do something like:
'Compiler &Compiler watch 'Compiler &Compiler watch
~~~ ~~~
{ '________ { 'Add_Zero
'________ 'Heap____
'________ 'Compiler
'________ '________
'________ '________
} 'WatchlistLabels d:create #5 , &, a:for-each } 'WatchlistLabels d:create #5 , &, a:for-each
'Watchlist d:create #5 , #5 allot 'Watchlist d:create #5 ,
#0 ,
&Heap ,
&Compiler ,
#5 allot
:watch (sa-) drop-pair ; :watch (sa-) drop-pair ;
:unwatch (a-) drop ; :unwatch (a-) drop ;
:watchlist (-) :watchlist (-)
#18 #84 vt:row,col #20 [ $- c:put ] times #18 #84 vt:row,col #20 [ $- c:put ] times
#19 #5 [ dup #84 vt:row,col #19 #5 [ dup #84 vt:row,col
&WatchlistLabels over #19 n:sub a:fetch s:put sp
&Watchlist over #19 n:sub a:fetch &Watchlist over #19 n:sub a:fetch
fetch n:put n:inc ] times drop ; fetch n:put n:inc ] times drop ;
~~~ ~~~
# ui # UI
Configure the UI colors. First are words to display the text output buffer.
~~~ ~~~
:dss:label (-) fg:red ; :bar:right dss:sep TOB:H n:inc [ I n:inc TOB:W #2 n:add vt:row,col $| c:put ] indexed-times vt:reset ;
:dss:value (-) fg:cyan ; :bar:bottom dss:sep TOB:H n:inc #1 vt:row,col TOB:W n:inc [ $= c:put ] times $+ c:put vt:reset ;
:dss:sep (-) fg:blue ; :display:tob (-) tob:display bar:right bar:bottom ;
:dss:prompt (-) bg:blue fg:white ;
~~~ ~~~
~~~ ~~~
:~left dss:sep TOB:H n:inc [ I n:inc #82 vt:row,col $| c:put ] indexed-times vt:reset ;
:~bottom dss:sep TOB:H n:inc #1 vt:row,col #81 [ $= c:put ] times $+ c:put vt:reset ;
'Items d:create #0 comma #32 allot 'Items d:create #0 comma #32 allot
:dss :dss
@ -145,7 +158,6 @@ is done.
dss:prompt dss:prompt
LT:H #1 vt:row,col LT:W [ sp ] times LT:H #1 vt:row,col LT:W [ sp ] times
LT:H #1 vt:row,col '>>_ s:put ; LT:H #1 vt:row,col '>>_ s:put ;
~~~ ~~~
Start of work on a new input model. The current one uses Start of work on a new input model. The current one uses
@ -169,9 +181,9 @@ that, so it's time to write a replacement.
:ui :ui
&err:notfound unhook &err:notfound unhook
&banner tob:with &banner tob:with
[ vt:clear vt:home tob:display [ vt:clear vt:home
~left stats dss ss watchlist display:tob
~bottom stats dss ss watchlist
prompt s:get vt:reset prompt s:get vt:reset
[ dup s:put nl s:evaluate ] tob:with [ dup s:put nl s:evaluate ] tob:with
] forever ; ] forever ;