[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 User's Guide



Using DialogBoxes

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.




View figure.

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:

  1. PromptDialogs for entering input

  2. CommandDialogs for entering keyboard commands

  3. SelectionDialogs for making a selection from a list of choices

  4. FileSelectionDialogs for entering the name of a file for processing

  5. MessageDialogs for displaying information

    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.




    View figure.

    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.




    View figure.

    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:

    1. Yes and No are answers to clearly posed questions. Selecting either of these buttons closes the DialogBox.

    2. OK applies any changes that you have made in the DialogBox and closes the DialogBox.

    3. Close closes the DialogBox without performing any action.

    4. Apply applies any changes that you have made in the DialogBox but does not close the DialogBox.

    5. Retry attempts the task in progress again. You will typically see this action in ErrorDialogs.

    6. Stop ends the current task at the earliest possible breaking point. This action is commonly found in WorkingDialogs.

    7. Pause pauses the task that is currently in progress. You will usually find this action in WorkingDialogs.

    8. Resume is used in conjuction with Pause. It causes a paused task to be resumed.

    9. Reset cancels any changes that have not already been applied to the application.

    10. Cancel closes the DialogBox without performing any actions that have not already been applied to the application.

    11. Help provides information about the dialog.

    12. [ Previous | Next | Contents | Glossary | Home | Search ]