Skip to Main Content
Volume 6A: Motif Programming Manual
book

Volume 6A: Motif Programming Manual

by David Brennan, Dan Heller, Paula Ferguson
September 1993
Intermediate to advanced content levelIntermediate to advanced
1014 pages
28h 26m
English
O'Reilly Media, Inc.
Content preview from Volume 6A: Motif Programming Manual
XmNtopAttachment, XmATTACH_FORM,
XmNleftAttachment, XmATTACH_FORM,
NULL);
two = XtVaCreateManagedWidget ("Two",
xmPushButtonWidgetClass, parent,
XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, one,
/* attach top of widget to same y coordinate as top of "one" */
XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNtopWidget, one,
NULL);
three = XtVaCreateManagedWidget ("Three",
xmPushButtonWidgetClass, parent,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, one,
/* attach left of widget to same x coordinate as left side of "one" */
XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNleftWidget, one,
NULL);
XtRealizeWidget (toplevel);
XtAppMainLoop (app);
}
The example uses three PushButton gadgets inside of a Form widget. The output of the program is shown in the
figure.
Output of attach.c
You should notice that the widgets are packed together quite tightly, which might not be how you expected them to
appear. In order to space the widgets more reasonably, we need to specify some distance between them using
attachment offsets.
9.4.2 Attachment Offsets
Attachment offsets control the spacing between widgets and the objects to which they are attached. The following
resources represent the attachment offsets for the four sides of a widget:
XmNleftOffset
XmNrightOffset
XmNtopOffset
XmNbottomOffset
9 Manager Widgets 9.4.2 Attachment Offsets
213
the figure shows the graphic representation of attachment ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Volume 7A: XView Programming Manual

Volume 7A: XView Programming Manual

Dan Heller

Publisher Resources

ISBN: 9780596000431