Next: The PromptDialog Widget Up: Dialogs Previous: ErrorWorking and Question Dialogs

Unwanted Dialog Buttons

When you create a Dialog, Motif will create 3 buttons - Ok, Cancel and Help - to allow user interaction with it.

There are many occasions when it is not natural to require the use of three buttons.

For instance in dialog1.c we only really need the user to acknowledge the InformationDialog and we do not need any help to choose whether to quit our program.

Motif provides a mechanism to disable unwanted buttons in a Dialog.

To remove a button:

In dialog2.c, we disable the Cancel and Help buttons on the InformationDialog and the Help button on the WarningDialog (Fig. 14). Otherwise this program is the same as dialog1.c

The function ScrubDial performs this task.

Fig. 14 dialog2.c output
Tue May 24 16:52:56 BST 1994