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
Output of text_form.c
Notice that the Labels are centered vertically with respect to their corresponding Text widgets. This arrangement
happened because each Label was stretched vertically in order to attach it to the top and bottom of the respective
Form. Of course, if the Labels were higher than the Text widgets, the Text widgets would be stretched instead.
Later, we'll show another version of this program that gives better results. As you can imagine, there are many
different ways for a Form, or any other manager widget, to manage the geometry of its children to produce the same
layout. Later, when we discuss the RowColumn widget, we will show you another solution to the problem of
horizontal alignment. It is important to remember that there is no right or wrong way to create a layout, as long as it
works for your application. However, you should be very careful to experiment with resizing issues as well as with
resources that can be set by the user that might affect widget layout, such as fonts and strings.
9.4.6 Common Problems
With a Form widget, you can specify a virtually unlimited number of attachments for its children. The dependencies
inherent in these attachments can lead to various errors in the layout of the widgets. One common problem involves
circular dependencies. The following code fragment shows a very simple example of a circular dependency:
w1 = XtVaCreateManagedWidget ...
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