summaryrefslogtreecommitdiff
path: root/test.rc
diff options
context:
space:
mode:
Diffstat (limited to 'test.rc')
-rwxr-xr-xtest.rc22
1 files changed, 13 insertions, 9 deletions
diff --git a/test.rc b/test.rc
index 11135a5..46710f8 100755
--- a/test.rc
+++ b/test.rc
@@ -1,13 +1,8 @@
#!/bin/rc
-rfork n
-
-delay=0.25
-
-guifs -s testgui
+delay=0.1
dir=/mnt/gui
-sleep $delay
# split the window vertically into two, and make the top one a textbox
echo vertical >> $dir/props/orientation
@@ -62,6 +57,15 @@ for(f in `{walk /mnt/gui | grep $dir'/[0-9]+/props/margin'}){
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
-sleep 1000000
+fn printevents {
+ while(event = `''{read}){
+ show $1': '$event
+ }
+}
+
+# Attach an event printer to the innermost elements
+for(f in `{walk /mnt/gui | grep $dir'/[0-9]+/event'}){
+ printevents $f <$f >[2]/dev/null &
+}
+
+wait