#!/bin/bash
#
# This is an example script demostrating the use of the 
# confirmation_dialog program from a script.
#
# You may copy and customize this script to your needs.
#

DIALOG="./confirmation_dialog"
PRESET="question_cancel"
TITLE="Confirmation Dialog Example"
MESSAGE="This is an example of how to use the\n\
confirmation_dialog with a shell script.\n\
\n\
Click on one of the buttons below to produce a response.\n\
The response will be printed to the terminal's stdout"


# Display Confirmation Dialog and get response
#
"$DIALOG" -p "$PRESET" -q -t "$TITLE" "$MESSAGE" "$@"
RESPONSE="$?"

# Print response response
#
echo -n "User responded with: "
case $RESPONSE in
 0)
  echo "\"No\""
 ;;
 1)
  echo "\"Yes\""
 ;;
 2)
  echo "\"Yes To All\""
 ;;
 3)
  echo "\"Cancel\""
 ;;
 4)
  echo "\"OK\""
 ;;
 *)
  echo "\"Other Response $?\""
 ;;
esac
