Motif applications use DialogBoxes for tasks that are of secondary importance in the application. A DialogBox may provide you with information, such as an error message, or ask you to enter information, such as a file to open. DialogBoxes may limit how you can interact with other windows in an application. A modal DialogBox requires that you respond before you can interact with any other components in the application. A modeless DialogBox does not limit your interaction with the rest of an application, so it can remain available for the duration of an application and be used to perform multiple actions.
Applications can design DialogBoxes with any number and any combination of components. Figure 3-9 shows a DialogBox that contains many different components for adjusting the settings for a text editor.
Figure 17. A Typical DialogBox.
At a minimum, a DialogBox contains a Label and a PushButton for supplying a response. The Motif toolkit provides the following types of DialogBoxes for general functions that are common to many applications:
Each of these DialogBoxes defines its own user interaction.
An application typically uses a PromptDialog to get information that it needs to continue processing. A PromptDialog usually interrupts your interaction with the rest of the program. The PromptDialog includes a message, a Text input area where you type the requested information, and PushButtons for responding to the DialogBox. Figure 3-10 shows a PromptDialog.
Figure 18. A PromptDialog.
Motif also provides a number of different types of MessageDialogs, including an ErrorDialog, an InformationDialog, a QuestionDialog, a WarningDialog, and a WorkingDialog. Each type of MessageDialog contains a graphical symbol that represents its purpose, a textual message, and PushButton commands that are appropriate for the DialogBox. Figure 3-11 shows a QuestionDialog. A QuestionDialog contains a question symbol, a message that asks you a question and PushButtons that allow you to answer the question.
Figure 19. A QuestionDialog.
Every DialogBox contains a row of PushButtons at the bottom of the box that allow you to respond to the DialogBox. The Motif Style Guide defines a number of common actions for DialogBoxes. The intent of the common actions is to provide you with consistent behavior in different Motif applications. In Motif Style Guide compliant applications, the common DialogBox actions have the following meaning and behavior: