Add a README.DRAGONFLY for contrib/dialog.
[dragonfly.git] / gnu / usr.bin / dialog / TESTS / treebox
1 #!/bin/sh
2 DIALOG=${DIALOG=/usr/bin/dialog}
3
4 $DIALOG --clear --title "TREE BOX" \
5         --hline "Press arrows, TAB or Enter" \
6         --hfile "../COPYING" \
7         --tree "/" \
8         "This is tree box" -1 -1 10 \
9         `find -x / -type d` 2>/tmp/tree.tmp.$$
10
11 retval=$?
12
13 choice=`cat /tmp/tree.tmp.$$`
14
15 case $retval in
16   0)
17     echo "'$choice' chosen.";;
18   1)
19     echo "Cancel pressed.";;
20   255)
21     [ -z "$choice" ] || echo $choice ;
22     echo "ESC pressed.";;
23 esac
24
25 rm -f /tmp/tree.tmp.$$