summaryrefslogtreecommitdiff
path: root/Build/source/utils/dialog/dialog-1.1-20080819/samples/editbox3
blob: 5522430514f14cf10fdf843360315aede80875e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# $Id: editbox3,v 1.1 2007/09/24 00:12:24 tom Exp $
# example with extra- and help-buttons
: ${DIALOG=dialog}

input=`tempfile 2>/dev/null` || input=/tmp/input$$
output=`tempfile 2>/dev/null` || output=/tmp/test$$
trap "rm -f $input $output" 0 1 2 5 15

cat << EOF > $input
EOF

$DIALOG --title "EDIT BOX" \
	--extra-button \
	--help-button \
	--fixed-font --editbox $input 0 0 2>$output

case $? in
  0)
    diff -c $input $output
    echo "OK"
    ;;
  1)
    echo "Button 1 (Cancel) pressed";;
  2)
    echo "Button 2 (Help) pressed";;
  3)
    echo "Button 3 (Extra) pressed";;
  255)
    echo "ESC pressed.";;
esac