previous next contents | bottom |
There are a few dialog "compatible" utilities around, some of them just mimic dialog without adding new features (e.g. gdialog), others add features and may differ in their syntax (cdialog, wdialog). I currently know about:
dialog --print-versionwhich should report v0.9 or higher for cdialog.
As a drop in replacement for dialog, cdialog and gdialog, Xdialog tries to maintain the highest degree of compatibility wherever possible. Because of the differences between a ncurses based console utility and a GTK+ based X11 utility, this compatibility is not perfect though. Also, the Xdialog development history introduces its own oddities and some of the default Xdialog behaviours are different from those of (c)dialog...
I came to the conclusion that the only way to keep the highest possible compatility without sacrifying any of the new features offered by Xdialog, was to make it behave in two possible ways, depending on its actual usage in each script (either as a drop in replacement or as a full featured independent utility).
The approach I adopted is to allow Xdialog behaviour customisation using specific environment variables. The advantage of this solution is that while modified with some environment variable assigments, the script is still usable with (c)dialog.
As of v2.0.0, Xdialog checks for the existence of the XDIALOG_HIGH_DIALOG_COMPAT environment variable; if this variable is set to "1" or "true" (case insensitive), then Xdialog behaves in the closest way to (c)dialog (dropping some of its features and adopting (c/g)dialog defaults and syntax), the net effect being that:
In order to take benefit of this improved compatibility in an existing (c)dialog script, you just have to add the following line to the script before the first invocation of Xdialog:
set XDIALOG_HIGH_DIALOG_COMPAT=trueor, if you use bash:
export XDIALOG_HIGH_DIALOG_COMPAT=true
Then, before each Xdialog invocation in the script, you may customize the behaviour of Xdialog by setting the XDIALOG_FORCE_AUTOSIZE and XDIALOG_INFOBOX_TIMEOUT environment variables.
Simple, isn't it ?
By default and whether XDIALOG_HIGH_DIALOG_COMPAT is set or not, Xdialog does its best to accept (c)dialog syntax and options:
cd /mit/outland/share/doc/Xdialog-2.1.2/samples;./install-wrapperThis wrapper will make any script using (c)dialog to call automatically Xdialog when a X display is available (if no X display is available, then the actual (c)dialog binary is called instead); to ensure the best possible compatibility, Xdialog is called by Xdialog.wrapper in high compatibility mode with forced autosize feature on (unless the XDIALOG_HIGH_DIALOG_COMPAT and/or the XDIALOG_FORCE_AUTOSIZE environment variables are already set, in which case their value is not changed by Xdialog.wrapper).
Some Xdialog widgets can't be made 100% (c)dialog compatible:
previous next contents | top |