The ConfirmVBT
module defines a dialog box
that displays a message and two buttons.
By default the two buttons are labeled ``Yes'' and ``Cancel''
(this cannot be changed in this rudimentary program).
By default the action taken when either button is pressed
is to delete the dialog box.
These actions can be supplied when the confirm VBT is created.
The message must be supplied in any case.
The intended scenario is that some client program is about to take some critical action, like quitting, and wants the user to confirm the action. The client program creates the confirm VBT with the appropriate message and actions associated and installs the VBT. The dialog pops up and the user can chose between cancelling the action or performing it. This sequence is depicted in the following two images:
The main program Confirm.m3 is a simple application with one button, a ``quit'' button. When pressed, a confirm VBT is popped up. The ``yes'' action exits the whole application. The ``cancel'' action invokes the default cancel action which is just to destroy the pop-up dialog. The main program has two subwindows with borders of different colors and textures.