Starting point for the terminal applications.

This commit is contained in:
2025-07-23 12:51:07 -04:00
parent dd0b0e58d1
commit 619150cfe7
3 changed files with 85 additions and 45 deletions

52
bin/color_picker.sh Executable file
View File

@ -0,0 +1,52 @@
. ~/cshenv/lib/vulgar.sh
erase_block 11 1 15 32
create_button Red 12 2 Red 1
highlight_button Red
#build_box 12 2 14 8
#write_string "Red" 13 4
#fill_block_attributes 12 2 14 8 41
create_button Green 12 12 Green 2
#build_box 12 12 14 20
#write_string "Green" 13 14
create_button Blue 12 24 Blue 4
#build_box 12 24 14 31
#write_string "Blue" 13 26
Buttons=("Red" "Green" "Blue")
Index=0
while true
do
read_key codes
sym=`translate_key ${codes}`
OldIndex=${Index}
if [ "${sym}" == "Right" ]
then
if (( ${Index} < $(( ${#Buttons} - 1 )) ))
then
Index=$(( ${Index} + 1 ))
unhighlight_button ${Buttons[${OldIndex}]}
highlight_button ${Buttons[${Index}]}
fi
elif [ "${sym}" == "Left" ]
then
if (( ${Index} > 0 ))
then
Index=$(( ${Index} - 1 ))
unhighlight_button ${Buttons[${OldIndex}]}
highlight_button ${Buttons[${Index}]}
fi
elif [ "${sym}" == "Escape" ]
then
#erase_block 11 1 15 32
break
fi
done