#!/bin/sh
#

# I prefer to tell "samples/yesno" for the source directory
D=/usr/bin/dialog

# this one means that "Esc" from any dialog will end the overall sample
check='eval if [ $? -eq 255 ] ; then clear; exit 1; fi'

#and tell the user about it.
$D -o " Sure! " -k\
   "The escape key may be used to terminate this long demo. Begin?" 6
$check

#
# Note that this sample is meant to be useful for the /bin/sh programmer,
# rather than the final user.
#

# The following show ones reconfigurable buttons

$D -o " Oui : Non " -y "Parlez vous francais?" 6 30
$check

$D -o " Yes : No :Hmmm" -s 1 -y "Do you *really* like dos?" 6 40
$check

# A messagebox

$D -o \
  "Enthusiasm:Admiration:aGreement:Disagreement:Complaint:Flame" \
  -s 2 --msgbox "         This is a msgbox, which is exactly like a yesno box.
           I'm sure this spurs a new feeling in your soul." 7 -2
$check

# A timed infobox

$D -o " 0 : 1 : 2 : 3 : 4 : 5 : 6 : 7 : 8 : 9 " -s 2 \
    --yesno "How many seconds do you want the followin infobox to last?" 6
wait=$?
$check

$D -i "Just a wide infobox, lasting $wait seconds" 3
#$check

sleep $wait

$D -B "Sample 1" -T "Fully-specified width" \
	--msgbox "A box with a silly message." 6 40
#if [ $? -eq 255 ] ; then  exit 1 ; fi

$check

$D -B "Sample 2" -T "small" --yesno "Small size. Do you like it?" 6 20
$check

$D -B "Sample 3" -T "wide" \
    --msgbox "
This silly box is default width. Try it with larger tty's.." 8
$check

#$D -B "Sample 4" -T "full" \
#	--msgbox "This is default size (full)."
#$check

$D -B "Sample 5" -T "The last one" --msgbox "
This is your fstab:

`cat /etc/fstab`
" -8 -5
$check


clear
