Xdialog [<common options>] [<transient options>] <box option> ...
and:
Xdialog <special option>
The [<common options>] [<transient options>] <box option> sequence may be repeated several times in the same Xdialog command line (this is called dialog chaining). The common/transient options may be omited but there must always be a <box option> as the last Xdialog option.
On completion of each box option (i.e. every time a widget is closed) Xdialog sends any result (text, numbers) as one or more strings to stderr (this can be changed so that the results are sent to stdout thanks to a common option).
When Xdialog terminates (i.e. when all the <box options> are processed or when an error occurs), the exit code may take the following values:
Note that when chaining dialogs, the chain is broken and Xdialog terminates as soon as a widget returns a non zero exit code.
When using Xdialog from a shell, it is therefore usually invoked as follow:
RESULTS=`Xdialog --stdout ...` # It is also possible to redirect Xdialog output to a temporary file. EXIT_CODE=$? case $EXIT_CODE in 0) # All OK. The $RESULTS variable holds everything entered/choosed by the user. .../... ;; 1) # Cancel/No pressed. .../... ;; 255) # An error occured or the box was closed. .../... ;; esac
For examples of how to use each widget, please read the box options section of this documentation and browse the samples directory.
Compatibility note:
Xdialog ignores any unknown transient/common option (and any associated parameters) passed into its command line. This allows to use Xdialog in place of (c)dialog in an existing script without removing the options that are irrelevant to Xdialog (such as --clear, --no-kill, etc...).