CH6.xml revision f353fbad
1994689c1Smrg<chapter id="composite_and_constraint_widgets"> 2f353fbadSmrg<title>Composite and Constraint Widgets</title> 3994689c1Smrg<para> 4994689c1SmrgThese widgets may contain arbitrary widget children. They implement a 5994689c1Smrgpolicy for the size and location of their children. 6994689c1Smrg</para> 7994689c1Smrg<para> 8994689c1Smrg<variablelist> 9994689c1Smrg <varlistentry> 10994689c1Smrg <term>Box</term> 11994689c1Smrg <listitem> 12994689c1Smrg <para> 13994689c1SmrgThis widget will pack its children as tightly as possible in non-overlapping rows. 14994689c1Smrg </para> 15994689c1Smrg </listitem> 16994689c1Smrg </varlistentry> 17994689c1Smrg <varlistentry> 18994689c1Smrg <term>Dialog</term> 19994689c1Smrg <listitem> 20994689c1Smrg <para> 21994689c1SmrgAn implementation of a commonly used interaction semantic to prompt for 22994689c1Smrgauxiliary input from the user, such as a filename. 23994689c1Smrg </para> 24994689c1Smrg </listitem> 25994689c1Smrg </varlistentry> 26994689c1Smrg <varlistentry> 27994689c1Smrg <term>Form</term> 28994689c1Smrg <listitem> 29994689c1Smrg <para> 30994689c1SmrgA more sophisticated layout widget that allows the children to specify 31994689c1Smrgtheir positions relative to the other children, or to the edges of the Form. 32994689c1Smrg </para> 33994689c1Smrg </listitem> 34994689c1Smrg </varlistentry> 35994689c1Smrg <varlistentry> 36994689c1Smrg <term>Paned</term> 37994689c1Smrg <listitem> 38994689c1Smrg <para> 39994689c1SmrgAllows children to be tiled vertically or horizontally. Controls are 40994689c1Smrgalso provided to allow the user to dynamically resize the individual panes. 41994689c1Smrg </para> 42994689c1Smrg </listitem> 43994689c1Smrg </varlistentry> 44994689c1Smrg <varlistentry> 45994689c1Smrg <term>Porthole</term> 46994689c1Smrg <listitem> 47994689c1Smrg <para> 48994689c1SmrgAllows viewing of a managed child which is as large as, or larger than its 49994689c1Smrgparent, typically under control of a Panner widget. 50994689c1Smrg </para> 51994689c1Smrg </listitem> 52994689c1Smrg </varlistentry> 53994689c1Smrg <varlistentry> 54994689c1Smrg <term>Tree</term> 55994689c1Smrg <listitem> 56994689c1Smrg <para> 57994689c1SmrgProvides geometry management of widgets arranged in a directed, acyclic graph. 58994689c1Smrg </para> 59994689c1Smrg </listitem> 60994689c1Smrg </varlistentry> 61994689c1Smrg <varlistentry> 62994689c1Smrg <term>Viewport</term> 63994689c1Smrg <listitem> 64994689c1Smrg <para> 65994689c1SmrgConsists of a frame, one or two scrollbars, and an inner window. The 66994689c1Smrginner window can contain all the data that is to be displayed. This inner 67994689c1Smrgwindow will be clipped by the frame with the scrollbars controlling 68994689c1Smrgwhich section of the inner window is currently visible. 69994689c1Smrg </para> 70994689c1Smrg </listitem> 71994689c1Smrg </varlistentry> 72994689c1Smrg</variablelist> 73994689c1Smrg</para> 74994689c1Smrg<note> 75994689c1Smrg<para> 76994689c1Smrg<!-- .LP --> 77994689c1SmrgThe geometry management semantics provided by the X Toolkit give full 78994689c1Smrgcontrol of the size and position of a widget to the parent of that 79994689c1Smrgwidget. While the children are allowed to request a certain size or 80994689c1Smrglocation, it is the parent who makes the final decision. Many of the 81994689c1Smrgcomposite widgets here will deny any geometry request from their 82994689c1Smrgchildren by default. If a child widget is not getting the expected size 83994689c1Smrgor location, it is most likely the parent disallowing a request, or 84994689c1Smrgimplementing semantics slightly different than those expected by the 85994689c1Smrgapplication programmer. 86994689c1Smrg</para> 87994689c1Smrg<para> 88994689c1Smrg<!-- .LP --> 89994689c1SmrgIf the application wishes to change the size or location of 90994689c1Smrgany widget it should make a call to <function>XtSetValues</function>. This will 91994689c1Smrg<!-- .IN "XtSetValues" "" --> 92994689c1Smrgallow the widget to ask its parent for the new size or location. 93994689c1SmrgAs noted above the parent is allowed to refuse this request, 94994689c1Smrgand the child must live with the result. If the 95994689c1Smrgapplication is unable to achieve the desired semantics, then perhaps it 96994689c1Smrgshould use a different composite widget. Under no circumstances 97994689c1Smrgshould an application programmer resort to <function>XtMoveWidget</function> or 98994689c1Smrg<!-- .IN "XtMoveWidget" "" --> 99994689c1Smrg<function>XtResizeWidget</function>; these functions are exclusively for the use of 100994689c1Smrg<!-- .IN "XtResizeWidget" "" --> 101994689c1SmrgComposite widget implementors. 102994689c1Smrg</para> 103994689c1Smrg<para> 104994689c1Smrg<!-- .LP --> 105994689c1SmrgFor more information on geometry management consult the <emphasis remap='I'>X Toolkit Intrinsics - C Language Interface</emphasis>. 106994689c1Smrg</para> 107994689c1Smrg</note> 108994689c1Smrg 109994689c1Smrg<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Box.xml"/> 110994689c1Smrg<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Dialog.xml"/> 111994689c1Smrg<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Form.xml"/> 112994689c1Smrg<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Paned.xml"/> 113994689c1Smrg<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Porthole.xml"/> 114994689c1Smrg<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Tree.xml"/> 115994689c1Smrg<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Viewport.xml"/> 116994689c1Smrg 117994689c1Smrg</chapter> 118