xref: /freebsd/contrib/dialog/samples/infobox5 (revision f4b37ed0f8b307b1f3f0f630ca725d68f1dff30d)
1#! /bin/sh
2# $Id: infobox5,v 1.7 2011/01/18 09:19:09 tom Exp $
3# get rid of all flickering by constructing a script unroll the loop, leaving
4# us in curses-mode until we're done counting.
5
6. ./setup-vars
7
8. ./setup-tempfile
9
10left=10
11unit="seconds"
12last='\'
13
14cat >>$tempfile <<EOF
15$DIALOG $last
16EOF
17
18while test $left != 0
19do
20
21cat >>$tempfile <<EOF
22	--sleep 1 \
23	--begin 0 5 \
24	--title "INFO BOX" $* \
25        --infobox "Hi, this is an information box. It is
26different from a message box: it will
27not pause waiting for input after displaying
28the message. The pause here is only introduced
29by the sleep command within dialog.
30You have $left $unit to read this..." 0 0 $last
31EOF
32
33left=`expr $left - 1`
34test $left = 1 && unit="second"
35done
36
37echo >>$tempfile
38
39. $tempfile
40