tAdd exit button to testbox.sh, just for the fun of it - ltk - Socket-based GUI for X11 (WIP)
HTML git clone git://lumidify.org/ltk.git (fast, but not encrypted)
HTML git clone https://lumidify.org/git/ltk.git (encrypted, but very slow)
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 50e3df1c749c8140ee3fa9be926e6591e329c6b9
DIR parent c162f582d06070c36e81117f1ab54ee91d7b2480
HTML Author: lumidify <nobody@lumidify.org>
Date: Sat, 30 Jan 2021 18:01:00 +0100
Add exit button to testbox.sh, just for the fun of it
Diffstat:
M testbox.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
DIR diff --git a/testbox.sh b/testbox.sh
t@@ -7,14 +7,15 @@ if [ $? -ne 0 ]; then
exit 1
fi
-cmds="box box1 create vertical\nset-root-widget box1\n$(curl -s gopher://lumidify.org | awk -F'\t' '
+cmds="box box1 create vertical\nset-root-widget box1\nbutton exit_btn create \"Exit\"\nbox box1 add exit_btn
+$(curl -s gopher://lumidify.org | awk -F'\t' '
BEGIN {btn = 0; lbl = 0;}
/^i/ { printf "label lbl%s create \"%s\"\nbox box1 add lbl%s w\n", lbl, substr($1, 2), lbl; lbl++ }
/^[1gI]/ { printf "button btn%s create \"%s\"\nbox box1 add btn%s w\n", btn, substr($1, 2), btn; btn++ }')"
echo "$cmds" | ./ltkc $ltk_id | while read cmd
do
case "$cmd" in
- "btn1 button_click")
+ "exit_btn button_click")
echo "quit"
;;
*)