From 0ad54d136ef33d61172658e97b538f7cd6a91c26 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Sun, 11 Feb 2024 16:39:26 +0000 Subject: Add a basic textbox element --- test.rc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test.rc') diff --git a/test.rc b/test.rc index 7179b3b..11135a5 100755 --- a/test.rc +++ b/test.rc @@ -9,10 +9,22 @@ guifs -s testgui dir=/mnt/gui sleep $delay +# split the window vertically into two, and make the top one a textbox +echo vertical >> $dir/props/orientation +textdir=$dir/`{cat $dir/clone} +echo textbox >> $textdir/type + +fn show { + echo -n $* >> $textdir/props/text +} + +dir=$dir/`{cat $dir/clone} + colours=(FF0000 00FF00 0000FF FFFF00 00FFFF FF00FF FFFFFF 333333) for(colour in $colours){ dir=$dir/`{cat $dir/clone} # Create a new sub element in the gui (for now, always a "container") echo $colour^FF >> $dir/props/background # Set the background + show 'setting background of '^$dir^' to 0x'^$colour sleep $delay # Wait a bit } @@ -20,12 +32,14 @@ for(colour in $colours){ for(colour in $colours){ subdir=$dir/`{cat $dir/clone} echo $colour^FF >> $subdir/props/background + show 'setting background of '^$subdir^' to 0x'^$colour sleep $delay } # Add some padding to all elements for(f in `{walk /mnt/gui/ | grep 'padding$'}){ echo 10 >> $f + show 'echo 10 >> '^$f sleep $delay } @@ -33,17 +47,20 @@ for(f in `{walk /mnt/gui/ | grep 'padding$'}){ for(f in `{walk /mnt/gui | grep $dir'/[0-9]+/props/border$'}){ echo 8888CCFF >> $f^colour echo 5 >> $f + show 'echo 5 >> '^$f sleep $delay } # Add some margin to the innermost elements for(f in `{walk /mnt/gui | grep $dir'/[0-9]+/props/margin'}){ echo 5 >> $f + show 'echo 5 >> '^$f sleep $delay } # Make the inner container vertical echo vertical >> $dir/props/orientation +show 'echo vertical >> '^$dir/props/orientation # when the script ends, the old text window draws over the gui. I will fix that later. # For now, i just make the script sleep for a long time -- cgit v1.2.3