1994689c1Smrg<sect1 id="Box_Widget"> 2994689c1Smrg<title>Box Widget</title> 3994689c1Smrg<para> 4994689c1Smrg<!-- .LP --> 5994689c1Smrg<!-- .XS --> 6994689c1Smrg<!-- Box Widget --> 7994689c1Smrg<!-- .XE --> 85ec34c4cSmrg<indexterm significance="preferred"><primary>Box widget</primary></indexterm> 9994689c1Smrg<literallayout class="monospaced"> 10994689c1Smrg<!-- .TA 2.0i --> 11994689c1Smrg<!-- .ta 2.0i --> 12994689c1Smrg<!-- .sp --> 13994689c1SmrgApplication Header file <X11/Xaw/Box.h> 145ec34c4cSmrg<indexterm><primary>Box.h</primary></indexterm> 15994689c1SmrgClass Header file <X11/Xaw/BoxP.h> 165ec34c4cSmrg<indexterm><primary>BoxP.h</primary></indexterm> 17994689c1SmrgClass boxWidgetClass 185ec34c4cSmrg<indexterm><primary>boxWidgetClass</primary></indexterm> 19994689c1SmrgClass Name Box 205ec34c4cSmrg<indexterm><primary>Box widget</primary><secondary>class name</secondary></indexterm> 21994689c1SmrgSuperclass Composite 22994689c1Smrg<!-- .sp --> 23994689c1Smrg</literallayout> 24994689c1Smrg</para> 25994689c1Smrg<para> 26994689c1Smrg<!-- .LP --> 27994689c1SmrgThe Box widget provides geometry management of arbitrary widgets in a 28994689c1Smrgbox of a specified dimension. The children are rearranged when 29994689c1Smrgresizing events occur either on the Box or its children, or when 30994689c1Smrgchildren are managed or unmanaged. The Box widget always attempts to 31994689c1Smrgpack its children as tightly as possible within the geometry allowed by 32994689c1Smrgits parent. 33994689c1Smrg</para> 34994689c1Smrg<para> 35994689c1Smrg<!-- .LP --> 36994689c1SmrgBox widgets are commonly used to manage a related set of buttons and 37994689c1Smrgare often called ButtonBox widgets, but the children are not 38994689c1Smrglimited to buttons. The Box's children are arranged on a background that 39994689c1Smrghas its own specified dimensions and color. 40994689c1Smrg</para> 41421c997bSmrg<sect2 id='Box::Resources'> 42994689c1Smrg<title>Resources</title> 43994689c1Smrg<para> 44994689c1Smrg<!-- .LP --> 45994689c1SmrgWhen creating a Box widget instance, the following resources are 46994689c1Smrgretrieved from the argument list or from the resource database: 47994689c1Smrg</para> 48994689c1Smrg<para> 49994689c1Smrg<!-- .LP --> 505ec34c4cSmrg<indexterm><primary>Box widget</primary><secondary>resources</secondary></indexterm> 51994689c1Smrg<informaltable> 52994689c1Smrg <tgroup cols='5' align='center'> 53994689c1Smrg <colspec colname='c1'/> 54994689c1Smrg <colspec colname='c2'/> 55994689c1Smrg <colspec colname='c3'/> 56994689c1Smrg <colspec colname='c4'/> 57994689c1Smrg <colspec colname='c5'/> 58994689c1Smrg <thead> 59994689c1Smrg <row> 60994689c1Smrg <entry>Name</entry> 61994689c1Smrg <entry>Class</entry> 62994689c1Smrg <entry>Type</entry> 63994689c1Smrg <entry>Notes</entry> 64994689c1Smrg <entry>Default Value</entry> 65994689c1Smrg </row> 66994689c1Smrg </thead> 67994689c1Smrg <tbody> 68994689c1Smrg <row> 69994689c1Smrg <entry>accelerators</entry> 70994689c1Smrg <entry>Accelerators</entry> 71994689c1Smrg <entry>AcceleratorTable</entry> 72994689c1Smrg <entry></entry> 73994689c1Smrg <entry>NULL</entry> 74994689c1Smrg </row> 75994689c1Smrg <row> 76994689c1Smrg <entry>ancestorSensitive</entry> 77994689c1Smrg <entry>AncestorSensitive</entry> 78994689c1Smrg <entry>Boolean</entry> 79994689c1Smrg <entry>D</entry> 80994689c1Smrg <entry>True</entry> 81994689c1Smrg </row> 82994689c1Smrg <row> 83994689c1Smrg <entry>background</entry> 84994689c1Smrg <entry>Background</entry> 85994689c1Smrg <entry>Pixel</entry> 86994689c1Smrg <entry></entry> 87994689c1Smrg <entry>XtDefaultBackground</entry> 88994689c1Smrg </row> 89994689c1Smrg <row> 90994689c1Smrg <entry>backgroundPixmap</entry> 91994689c1Smrg <entry>Pixmap</entry> 92994689c1Smrg <entry>Pixmap</entry> 93994689c1Smrg <entry></entry> 94994689c1Smrg <entry>XtUnspecifiedPixmap</entry> 95994689c1Smrg </row> 96994689c1Smrg <row> 97994689c1Smrg <entry>borderColor</entry> 98994689c1Smrg <entry>BorderColor</entry> 99994689c1Smrg <entry>Pixel</entry> 100994689c1Smrg <entry></entry> 101994689c1Smrg <entry>XtDefaultForeground</entry> 102994689c1Smrg </row> 103994689c1Smrg <row> 104994689c1Smrg <entry>borderPixmap</entry> 105994689c1Smrg <entry>Pixmap</entry> 106994689c1Smrg <entry>Pixmap</entry> 107994689c1Smrg <entry></entry> 108994689c1Smrg <entry>XtUnspecifiedPixmap</entry> 109994689c1Smrg </row> 110994689c1Smrg <row> 111994689c1Smrg <entry>borderWidth</entry> 112994689c1Smrg <entry>BorderWidth</entry> 113994689c1Smrg <entry>Dimension</entry> 114994689c1Smrg <entry></entry> 115994689c1Smrg <entry>1</entry> 116994689c1Smrg </row> 117994689c1Smrg <row> 118994689c1Smrg <entry>children</entry> 119994689c1Smrg <entry>ReadOnly</entry> 120994689c1Smrg <entry>WidgetList</entry> 121994689c1Smrg <entry>R</entry> 122994689c1Smrg <entry>NULL</entry> 123994689c1Smrg </row> 124994689c1Smrg <row> 125994689c1Smrg <entry>colormap</entry> 126994689c1Smrg <entry>Colormap</entry> 127994689c1Smrg <entry>Colormap</entry> 128994689c1Smrg <entry></entry> 129994689c1Smrg <entry>Parent's Colormap</entry> 130994689c1Smrg </row> 131994689c1Smrg <row> 132994689c1Smrg <entry>depth</entry> 133994689c1Smrg <entry>Depth</entry> 134994689c1Smrg <entry>int</entry> 135994689c1Smrg <entry>C</entry> 136994689c1Smrg <entry>Parent's Depth</entry> 137994689c1Smrg </row> 138994689c1Smrg <row> 139994689c1Smrg <entry>destroyCallback</entry> 140994689c1Smrg <entry>Callback</entry> 141994689c1Smrg <entry>XtCallbackList</entry> 142994689c1Smrg <entry></entry> 143994689c1Smrg <entry>NULL</entry> 144994689c1Smrg </row> 145994689c1Smrg <row> 146994689c1Smrg <entry>height</entry> 147994689c1Smrg <entry>Height</entry> 148994689c1Smrg <entry>Dimension</entry> 149994689c1Smrg <entry>A</entry> 150994689c1Smrg <entry>see <function>Layout Semantics</function></entry> 151994689c1Smrg </row> 152994689c1Smrg <row> 153994689c1Smrg <entry>hSpace</entry> 154994689c1Smrg <entry>HSpace</entry> 155994689c1Smrg <entry>Dimension</entry> 156994689c1Smrg <entry></entry> 157994689c1Smrg <entry>4</entry> 158994689c1Smrg </row> 159994689c1Smrg <row> 160994689c1Smrg <entry>mappedWhenManaged</entry> 161994689c1Smrg <entry>MappedWhenManaged</entry> 162994689c1Smrg <entry>Boolean</entry> 163994689c1Smrg <entry></entry> 164994689c1Smrg <entry>True</entry> 165994689c1Smrg </row> 166994689c1Smrg <row> 167994689c1Smrg <entry>numChildren</entry> 168994689c1Smrg <entry>ReadOnly</entry> 169994689c1Smrg <entry>Cardinal</entry> 170994689c1Smrg <entry>R</entry> 171994689c1Smrg <entry>0</entry> 172994689c1Smrg </row> 173994689c1Smrg <row> 174994689c1Smrg <entry>orientation</entry> 175994689c1Smrg <entry>Orientation</entry> 176994689c1Smrg <entry>Orientation</entry> 177994689c1Smrg <entry></entry> 178994689c1Smrg <entry>XtorientVertical</entry> 179994689c1Smrg </row> 180994689c1Smrg <row> 181994689c1Smrg <entry>screen</entry> 182994689c1Smrg <entry>Screen</entry> 183994689c1Smrg <entry>Screen</entry> 184994689c1Smrg <entry>R</entry> 185994689c1Smrg <entry>Parent's Screen</entry> 186994689c1Smrg </row> 187994689c1Smrg <row> 188994689c1Smrg <entry>sensitive</entry> 189994689c1Smrg <entry>Sensitive</entry> 190994689c1Smrg <entry>Boolean</entry> 191994689c1Smrg <entry></entry> 192994689c1Smrg <entry>True</entry> 193994689c1Smrg </row> 194994689c1Smrg <row> 195994689c1Smrg <entry>vSpace</entry> 196994689c1Smrg <entry>VSpace</entry> 197994689c1Smrg <entry>Dimension</entry> 198994689c1Smrg <entry></entry> 199994689c1Smrg <entry>4</entry> 200994689c1Smrg </row> 201994689c1Smrg <row> 202994689c1Smrg <entry>translations</entry> 203994689c1Smrg <entry>Translations</entry> 204994689c1Smrg <entry>TranslationTable</entry> 205994689c1Smrg <entry></entry> 206994689c1Smrg <entry>NULL</entry> 207994689c1Smrg </row> 208994689c1Smrg <row> 209994689c1Smrg <entry>width</entry> 210994689c1Smrg <entry>Width</entry> 211994689c1Smrg <entry>Dimension</entry> 212994689c1Smrg <entry>A</entry> 213994689c1Smrg <entry>see <function>Layout Semantics</function></entry> 214994689c1Smrg </row> 215994689c1Smrg <row> 216994689c1Smrg <entry>x</entry> 217994689c1Smrg <entry>Position</entry> 218994689c1Smrg <entry>Position</entry> 219994689c1Smrg <entry></entry> 220994689c1Smrg <entry>0</entry> 221994689c1Smrg </row> 222994689c1Smrg <row> 223994689c1Smrg <entry>y</entry> 224994689c1Smrg <entry>Position</entry> 225994689c1Smrg <entry>Position</entry> 226994689c1Smrg <entry></entry> 227994689c1Smrg <entry>0</entry> 228994689c1Smrg </row> 229994689c1Smrg <row> 230994689c1Smrg <entry>_</entry> 231994689c1Smrg </row> 232994689c1Smrg </tbody> 233994689c1Smrg </tgroup> 234994689c1Smrg</informaltable> 235994689c1Smrg<!-- .Ac --> 236994689c1Smrg<!-- .As --> 237994689c1Smrg<!-- .Bg --> 238994689c1Smrg<!-- .Gp --> 239994689c1Smrg<!-- .Bc --> 240994689c1Smrg<!-- .Bp --> 241994689c1Smrg<!-- .Bw --> 242994689c1Smrg<!-- .Ch --> 243994689c1Smrg<!-- .Cm --> 244994689c1Smrg<!-- .Dp --> 245994689c1Smrg<!-- .Dc --> 246994689c1Smrg<!-- .Hw --> 247994689c1Smrg<variablelist> 248994689c1Smrg <varlistentry> 249994689c1Smrg <term> 250994689c1Smrg <function>hSpace</function> 251994689c1Smrg </term> 252994689c1Smrg <listitem> 253994689c1Smrg <para> 254994689c1Smrg<!-- .br --> 255994689c1Smrg<!-- .ns --> 256994689c1Smrg </para> 257994689c1Smrg </listitem> 258994689c1Smrg </varlistentry> 259994689c1Smrg <varlistentry> 260994689c1Smrg <term> 261994689c1Smrg <function>vSpace</function> 262994689c1Smrg </term> 263994689c1Smrg <listitem> 264994689c1Smrg <para> 265994689c1SmrgThe amount of space, in pixels, to leave between the children. This 266994689c1Smrgresource specifies the amount of space left between the outermost 267994689c1Smrgchildren and the edge of the box. 268994689c1Smrg<!-- .Mm --> 269994689c1Smrg<!-- .Nc --> 270994689c1Smrg </para> 271994689c1Smrg </listitem> 272994689c1Smrg </varlistentry> 273994689c1Smrg <varlistentry> 274994689c1Smrg <term> 275994689c1Smrg <function>orientation</function> 276994689c1Smrg </term> 277994689c1Smrg <listitem> 278994689c1Smrg <para> 279994689c1SmrgSpecifies whether the preferred shape of the box (i.e. the result 280994689c1Smrgreturned by the query_geometry class method) is tall and narrow 281994689c1Smrg<function>XtorientVertical</function> or short and wide <function>XtorientHorizontal</function>. 2825ec34c4cSmrg<indexterm><primary>XtorientVertical</primary></indexterm> 2835ec34c4cSmrg<indexterm><primary>XtorientHorizontal</primary></indexterm> 2845ec34c4cSmrg<indexterm><primary>conversions</primary><secondary>Orientation</secondary></indexterm> 285994689c1SmrgWhen the Box is a child of a parent which enforces width constraints, it 286994689c1Smrgis usually better to specify <function>XtorientVertical</function> (the default). 287994689c1SmrgWhen the parent enforces height constraints, it is usually better to 288994689c1Smrgspecify <function>XtorientHorizontal</function>. 289994689c1Smrg<!-- .Rs "horizontal \fPand\fB vertical" --> 290994689c1Smrg<!-- .Sc --> 291994689c1Smrg<!-- .Se --> 292994689c1Smrg<!-- .Tr --> 293994689c1Smrg<!-- .Xy --> 294994689c1Smrg </para> 295994689c1Smrg </listitem> 296994689c1Smrg </varlistentry> 297994689c1Smrg</variablelist> 298994689c1Smrg</para> 299994689c1Smrg</sect2> 300994689c1Smrg<sect2 id="Layout_Semantics"> 301994689c1Smrg<title>Layout Semantics</title> 3025ec34c4cSmrg<indexterm><primary>Box widget</primary><secondary>layout semantics</secondary></indexterm> 303994689c1Smrg<para> 304994689c1Smrg<!-- .LP --> 305994689c1SmrgEach time a child is managed or unmanaged, the Box widget will attempt 306994689c1Smrgto reposition the remaining children to compact the box. Children are 307994689c1Smrgpositioned in order left to right, top to bottom. The packing 308994689c1Smrgalgorithm used depends on the <function>orientation</function> of the Box. 309994689c1Smrg<variablelist> 310994689c1Smrg <varlistentry> 311994689c1Smrg <term> 312994689c1Smrg <function>XtorientVertical</function> 313994689c1Smrg </term> 314994689c1Smrg <listitem> 315994689c1Smrg <para> 3165ec34c4cSmrg<indexterm significance="preferred"><primary>XtorientVertical</primary></indexterm> 317994689c1SmrgWhen the next child does not fit on the current row, a new row is 318994689c1Smrgstarted. If a child is wider than the width of the box, the box will 319994689c1Smrgrequest a larger width from its parent and will begin the layout 320994689c1Smrgprocess from the beginning if a new width is granted. 321994689c1Smrg </para> 322994689c1Smrg </listitem> 323994689c1Smrg </varlistentry> 324994689c1Smrg <varlistentry> 325994689c1Smrg <term> 326994689c1Smrg <function>XtorientHorizontal</function> 327994689c1Smrg </term> 328994689c1Smrg <listitem> 329994689c1Smrg <para> 3305ec34c4cSmrg<indexterm significance="preferred"><primary>XtorientHorizontal</primary></indexterm> 331994689c1SmrgWhen the next child does not fit on the current row, the Box widens if 332994689c1Smrgpossible (so as to keep children on a single row); otherwise a new row is 333994689c1Smrgstarted. 334994689c1Smrg </para> 335994689c1Smrg </listitem> 336994689c1Smrg </varlistentry> 337994689c1Smrg</variablelist> 338994689c1Smrg</para> 339994689c1Smrg<para> 340994689c1Smrg<!-- .LP --> 341994689c1SmrgAfter positioning all children, the Box widget attempts to shrink its 342994689c1Smrgown size to the minimum dimensions required for the layout. 343994689c1Smrg 344994689c1Smrg</para> 345994689c1Smrg</sect2> 346994689c1Smrg</sect1> 347