The jconfirm Confirmation Tool

Introduction

The jconfirm application is just a wrapper around the j:confirm procedure in the jconfirm.tcl library. It's intended to make it easy to ask the user to confirm an action from shell scripts, window­manager menus, etc.

This document describes jconfirm version 1998.09.30.

Copyright and contact information is available in the jstools documentation.

Invocation and Usage

jconfirm [-text text] [-title title] [other options]

Invoking jconfirm brings up a panel displaying text with two buttons marked OK and Cancel. The panel's window­manager title will be title. If the user clicks OK, jconfirm will exit with zero status (i.e., true, in shell­script terms); if sie clicks Cancel, it will exit with non­zero (false) status.

There are a few other options; see j:confirm in the jconfirm.tcl library for full details. In particular, you can specify the text on the OK and Cancel buttons.

Note, however, j:confirm's -priority option is not available; the confirmation panel created by jconfirm will appear regardless of the user's jstools preferences. (The jstools applications generally use j:confirm to ask the user to confirm actions sie has presumably requested, but I can imagine jconfirm being used in shell scripts to ask questions, and I didn't want to make you remember to add `-priority 100' all the time.)

Both prompt and title are localisable.

Example

if jconfirm -text "Delete your home directory?" \
-yesbutton Yes -nobutton No
then
exec /bin/rm -rf $HOME
else
jalert -text "Oh, where's your sense of adventure?"
fi

Evolution

Feel free to report bugs (and feature requests) to me, <js@aq.org>, and I will try to deal with them. Also, feel free to fix bugs or add features on your own and let me know how you did it.