xref: /freebsd/contrib/dialog/samples/infobox6 (revision 0b3105a37d7adcadcb720112fed4dc4e8040be99)
1#! /bin/sh
2# $Id: infobox6,v 1.7 2011/01/18 09:20:59 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# a little fancier than infobox5, this moves the widget at each step.
7
8. ./setup-vars
9
10. ./setup-tempfile
11
12left=10
13unit="seconds"
14last='\'
15
16cat >>$tempfile <<EOF
17$DIALOG $last
18EOF
19
20while test $left != 0
21do
22
23cat >>$tempfile <<EOF
24	--sleep 1 \
25	--begin $left `expr $left + 5` \
26	--title "INFO BOX" $* $last
27        --infobox "Hi, this is an information box. It is
28different from a message box: it will
29not pause waiting for input after displaying
30the message. The pause here is only introduced
31by the sleep command within dialog.
32You have $left $unit to read this..." 0 0 $last
33EOF
34
35left=`expr $left - 1`
36test $left = 1 && unit="second"
37done
38
39echo >>$tempfile
40
41. $tempfile
42