XmNtopAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
/* prepare the text for display in the ScrolledText object
* we are about to create.
*/
for (p = buf, i = 0; help_texts[item_no][i]; i++) {
p += strlen (strcpy (p, help_texts[item_no][i]));
if (!isspace (p[−1])) /* spaces, tabs and newlines are spaces.. */
*p++ = ' '; /* lines are concatenated together, insert a space */
}
*−−p = 0; /* get rid of trailing space... */
XtSetArg (args[n], XmNscrollVertical, True); n++;
XtSetArg (args[n], XmNscrollHorizontal, False); n++;
XtSetArg (args[n], XmNeditMode, XmMULTI_LINE_EDIT); n++;
XtSetArg (args[n], XmNeditable, False); n++;
XtSetArg (args[n], XmNcursorPositionVisible, False); n++;
XtSetArg (args[n], XmNwordWrap, True); n++;
XtSetArg (args[n], XmNvalue, buf); n++;
XtSetArg (args[n], XmNrows, 5); n++;
text_w = XmCreateScrolledText(form, "help_text", args, n);
/* Attachment values must be set on the Text widget's PARENT,
* the ScrolledWindow. This is the object that is positioned.
*/
XtVaSetValues (XtParent (text_w),
XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, label,
XmNtopAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
XtManageChild (text_w);
XtManageChild (form);
/* Create another form to act as the action area for the dialog */
form = XtVaCreateWidget ("form2", xmFormWidgetClass, pane,
XmNfractionBase, 5,
NULL);
/* The OK button is under the pane's separator and is
* attached to the left edge ...