#!/bin/sh
# this is not compatible with (c)dialog [ncurses]

NO_NCURSES_COMPAT=1
. ./0common.sh || exit 1

NAME=$(
$DIALOG --stdout --wrap --title "Chain test" \
        --msgbox "This is a simple dialogs chaining demonstration" 0 0 \
        --buttons-style text --yesno "Continue ?" 0 0 \
        --buttons-style icon --inputbox "Please give me your name" 0 0 "" \
        --icon ./dialog-warning.png --rc-file ./bluebox.rc --buttons-style default \
        --msgbox "End of demo..." 0 0
)

case $? in
	0)
		echo "All OK.";;
	1)
		echo "Cancel pressed !";;
	255)
		echo "Box closed !";;
esac

if [ "$NAME" != "" ] ; then
	echo "\"$NAME\" entered."
fi
