1XmForm(3) LessTif Manuals XmForm(3)
2
3
4
6 XmForm - Motif-compatible form widget container
7
9 #include <Xm/Form.h>
10
11 XmForm
12
13 XmCreateForm
14
16 XmForm is a widget which allows you to specify complicated geometries.
17 The widget is capable of aligning children widgets with reference to
18 each other. Widgets can be linked to each other's positions, hooked to
19 a fixed place, or hooked to the form's edges. Positioning can be rela‐
20 tive as well as absolute.
21
22 The algorithm used to lay out the children is an iterative one. In
23 development versions of LessTif, the amount of iterations that the wid‐
24 get supports before it wants to have reached a steady state is 200.
25 OSF/Motif® uses a much higher number than this; if the low number in
26 LessTif gives you trouble (it generates a warning message mentioning
27 "bailout") then either the number is too low or you've discovered a
28 bug.
29
31 Name Class Type Default Access
32 ─────────────────────────────────────────────────────────────────────────────────────
33 XmNmarginWidth XmCMarginWidth HorizontalDimension 0 CSG
34 XmNmarginHeight XmCMarginHeight VerticalDimension 0 CSG
35 XmNhorizontalSpacing XmCSpacing HorizontalDimension 0 CSG
36 XmNverticalSpacing XmCSpacing VerticalDimension 0 CSG
37 XmNfractionBase XmCMaxValue Int 100 CSG
38 XmNrubberPositioning XmCRubberPositioning Boolean False CSG
39
40 XmNfractionBase is the resource that allows you to specify the refer‐
41 ence value relative to which values for the constraint resource XmNpo‐
42 sition are to be used. The default, 100, allows you to specify e.g. 50
43 to mean that some widget edge should be positioned at 50% of the form's
44 width (or height).
45
46 XmNrubberPositioning is a boolean which determines the default layout
47 if some of the constraint resources aren't set for children of XmForm.
48 In the default case (False), children widgets for which the left or top
49 sides haven't been specified, default their attachment to XmAT‐
50 TACH_FORM. This means the children will be in the upper left side of
51 the form. In the other case, the children widgets's left or top
52 attachments will default to XmATTACH_SELF.
53
54 XmNmarginWidth
55
56 XmNmarginHeight
57
58 XmNhorizontalSpacing
59
60 XmNverticalSpacing
61
63 The constraint resources for XmForm allow us to specify the layout of
64 children of the form. These resources should not be set on the form,
65 they should be set on the children. They don't work unless the parent
66 of a widget is an XmForm, they also don't work if the widget is a
67 grandchild of XmForm.
68
69 The latter is a mistake often made in the case of scrolled widgets.
70 Functions such as XmCreateScrolledText create two (or more) widgets,
71 and return a grandchild of Form if they are called with the form as
72 parent. In such case, constraint resources should be set on the parent
73 of the widget returned by XmCreateScrolledText (or similar).
74
75 Name Class Type Default Access
76 ───────────────────────────────────────────────────────────────────────
77 XmNtopAttachment XmCAttachment unsigned char dynamic CSG
78 XmNbottomAttachment XmCAttachment unsigned char dynamic CSG
79 XmNleftAttachment XmCAttachment unsigned char dynamic CSG
80 XmNrightAttachment XmCAttachment unsigned char dynamic CSG
81 XmNtopWidget XmCWidget Widget NULL CSG
82 XmNbottomWidget XmCWidget Widget NULL CSG
83 XmNleftWidget XmCWidget Widget NULL CSG
84 XmNrightWidget XmCWidget Widget NULL CSG
85 XmNtopPosition XmCPosition int 0 CSG
86 XmNbottomPosition XmCPosition int 0 CSG
87 XmNleftPosition XmCPosition int 0 CSG
88 XmNrightPosition XmCPosition int 0 CSG
89 XmNtopOffset XmCOffset int 0 CSG
90 XmNbottomOffset XmCOffset int 0 CSG
91 XmNleftOffset XmCOffset int 0 CSG
92 XmNrightOffset XmCOffset int 0 CSG
93 XmNresizable XmCBoolean Boolean True CSG
94
95 XmNresizable specifies whether this widget can resize itself, if the
96 geometry request doesn't conflict with attachments. An example of this
97 is a XmLabel widget which modifies its XmNlabelString, which causes it
98 to try to resize itself. If XmNresizable is set to False in such a
99 case, expensive geometry calculations can be avoided.
100
101 XmNtopAttachment is the method of attachment for the child's top side
102 XmNtopWidget is the ID of the widget or gadget that serves as attach‐
103 ment point for the top of this child. For this to work, XmNtopAttach‐
104 ment must be set to XmATTACH_WIDGET or to XmATTACH_OPPOSITE_WIDGET.
105
106 XmNtopPosition used in conjunction with XmNfractionBase allows you to
107 calculate the position of the top of a child widget relative to the top
108 of the Form. This resource only works if XmNtopAttachment has been set
109 to XmATTACH_POSITION. A position can be a negative number, which
110 allows you to position a child widget in a place which is either par‐
111 tially or completely invisible. Values larger than the value of XmN‐
112 fractionBase, or close to it, have similar effect.
113
114 XmNtopOffset is the distance between the child's top edge and the
115 object it is attached to. This may be the form (XmATTACH_FORM) or
116 another widget (XmATTACH_WIDGET or XmATTACH_OPPOSITE_WIDGET). In the
117 latter case (XmATTACH_OPPOSITE_WIDGET), the offset is relative to the
118 other widget's top. In the other cases, the offset is relative to the
119 form's top or to the other widget's bottom edge.
120
121 As with XmNtopPosition, values can be specified which are either nega‐
122 tive or large, to position the child widget at a place where it is
123 either partially or completely invisible.
124
126 Object(3) Rect(3) UnNamedObj(3) Core(3) Composite(3) Constraint(3)
127 XmManager(3) XmBulletinBoard(3) XmForm(3)
128
130 XmForm only has callbacks inherited from its superclasses.
131
134LessTif Project April 1998 XmForm(3)