CH6.xml revision 5ec34c4c
1<chapter id='Composite_and_Constraint_Widgets'> 2<title>Composite and Constraint Widgets</title> 3<para> 4These widgets may contain arbitrary widget children. They implement a 5policy for the size and location of their children. 6</para> 7<para> 8<variablelist> 9 <varlistentry> 10 <term>Box</term> 11 <listitem> 12 <para> 13This widget will pack its children as tightly as possible in non-overlapping rows. 14 </para> 15 </listitem> 16 </varlistentry> 17 <varlistentry> 18 <term>Dialog</term> 19 <listitem> 20 <para> 21An implementation of a commonly used interaction semantic to prompt for 22auxiliary input from the user, such as a filename. 23 </para> 24 </listitem> 25 </varlistentry> 26 <varlistentry> 27 <term>Form</term> 28 <listitem> 29 <para> 30A more sophisticated layout widget that allows the children to specify 31their positions relative to the other children, or to the edges of the Form. 32 </para> 33 </listitem> 34 </varlistentry> 35 <varlistentry> 36 <term>Paned</term> 37 <listitem> 38 <para> 39Allows children to be tiled vertically or horizontally. Controls are 40also provided to allow the user to dynamically resize the individual panes. 41 </para> 42 </listitem> 43 </varlistentry> 44 <varlistentry> 45 <term>Porthole</term> 46 <listitem> 47 <para> 48Allows viewing of a managed child which is as large as, or larger than its 49parent, typically under control of a Panner widget. 50 </para> 51 </listitem> 52 </varlistentry> 53 <varlistentry> 54 <term>Tree</term> 55 <listitem> 56 <para> 57Provides geometry management of widgets arranged in a directed, acyclic graph. 58 </para> 59 </listitem> 60 </varlistentry> 61 <varlistentry> 62 <term>Viewport</term> 63 <listitem> 64 <para> 65Consists of a frame, one or two scrollbars, and an inner window. The 66inner window can contain all the data that is to be displayed. This inner 67window will be clipped by the frame with the scrollbars controlling 68which section of the inner window is currently visible. 69 </para> 70 </listitem> 71 </varlistentry> 72</variablelist> 73</para> 74<note> 75<para> 76<!-- .LP --> 77The geometry management semantics provided by the X Toolkit give full 78control of the size and position of a widget to the parent of that 79widget. While the children are allowed to request a certain size or 80location, it is the parent who makes the final decision. Many of the 81composite widgets here will deny any geometry request from their 82children by default. If a child widget is not getting the expected size 83or location, it is most likely the parent disallowing a request, or 84implementing semantics slightly different than those expected by the 85application programmer. 86</para> 87<para> 88<!-- .LP --> 89If the application wishes to change the size or location of 90any widget it should make a call to <xref linkend='XtSetValues' xrefstyle='select: title'/>. This will 91<indexterm><primary>XtSetValues</primary></indexterm> 92allow the widget to ask its parent for the new size or location. 93As noted above the parent is allowed to refuse this request, 94and the child must live with the result. If the 95application is unable to achieve the desired semantics, then perhaps it 96should use a different composite widget. Under no circumstances 97should an application programmer resort to <function>XtMoveWidget</function> or 98<indexterm><primary>XtMoveWidget</primary></indexterm> 99<function>XtResizeWidget</function>; these functions are exclusively for the use of 100<indexterm><primary>XtResizeWidget</primary></indexterm> 101Composite widget implementors. 102</para> 103<para> 104<!-- .LP --> 105For more information on geometry management consult the 106<olink targetdoc='intrinsics' targetptr='Geometry_Management' 107><citetitle>X Toolkit Intrinsics - C Language Interface</citetitle></olink>. 108</para> 109</note> 110 111<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Box.xml"/> 112<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Dialog.xml"/> 113<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Form.xml"/> 114<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Paned.xml"/> 115<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Porthole.xml"/> 116<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Tree.xml"/> 117<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Viewport.xml"/> 118 119</chapter> 120