XmString t;
int n = 0;
t = XmStringCreateLocalized ("Hello World");
XtSetArg (arg[n], XmNmessageString, t); n++;
dialog = XmCreateMessageDialog (parent, "message", arg, n);
XmStringFree (t);
The convenience routine does almost everything automatically. The only thing that we have to do is specify the
message that we want to display.
6.3.1 Dialog Header Files
As we mentioned earlier, there are two basic types of predefined Motif dialog boxes: MessageDialogs and
SelectionDialogs. MessageDialogs present a simple message, to which a yes (OK) or no (Cancel) response usually
suffices. There are six types of MessageDialogs: ErrorDialog, InformationDialog, QuestionDialog, TemplateDialog,
WarningDialog, and WorkingDialog. These types are not actually separate widget classes, but rather instances of the
generic MessageDialog that are configured to display different graphic symbols. All of the MessageDialogs are
compound objects that are composed of a MessageBox widget and a DialogShell. When using MessageDialogs, you
must include the file <Xm/MessageB.h>.
SelectionDialogs allow for more complicated interactions. The user can select an item from a list or type an entry into
a TextField widget before acting on the dialog. There are essentially four types of SelectionDialogs, although the
situation is a bit more complex than for MessageDialogs. The PromptDialog is a specially configured
SelectionDialog; both of these dialogs are compound objects that are composed of a SelectionBox widget and a
DialogShell. ...