Initial import from FreeBSD RELENG_4:
[games.git] / gnu / usr.bin / dialog / TESTS / ftreebox
1 #!/bin/sh
2 DIALOG=${DIALOG=/usr/bin/dialog}
3
4 find -xd / -type d > /tmp/ftreebox.tmp.$$
5
6 $DIALOG --clear --title "FTREE BOX" \
7         --hline "Press arrows, TAB or Enter" \
8         --hfile "../COPYING" \
9         --ftree "/tmp/ftreebox.tmp.$$" "/" \
10         "This is ftree box" \
11         -1 -1 10 2>/tmp/ftree.tmp.$$
12
13 retval=$?
14
15 choice=`cat /tmp/ftree.tmp.$$`
16
17 case $retval in
18   0)
19     echo "'$choice' chosen.";;
20   1)
21     echo "Cancel pressed.";;
22   255)
23     [ -z "$choice" ] || echo $choice ;
24     echo "ESC pressed.";;
25 esac
26
27 rm -f /tmp/ftreebox.tmp.$$ /tmp/ftree.tmp.$$