1994689c1Smrg<sect1 id="List_Widget">
2994689c1Smrg<title>List Widget</title>
3994689c1Smrg<para>
4994689c1Smrg<!-- .LP -->
5994689c1Smrg<!-- .XS -->
6994689c1Smrg<!-- 	List Widget -->
7994689c1Smrg<!-- .XE -->
85ec34c4cSmrg<indexterm significance="preferred"><primary>List widget</primary></indexterm>
9994689c1Smrg<literallayout class="monospaced">
10994689c1Smrg<!-- .TA 2.0i -->
11994689c1Smrg<!-- .ta 2.0i -->
12994689c1Smrg<!-- .sp -->
13994689c1SmrgApplication header file	&lt;X11/Xaw/List.h&gt;
145ec34c4cSmrg<indexterm><primary>List.h</primary></indexterm>
15994689c1SmrgClass header file	&lt;X11/Xaw/ListP.h&gt;
165ec34c4cSmrg<indexterm><primary>ListP.h</primary></indexterm>
17994689c1SmrgClass	listWidgetClass
185ec34c4cSmrg<indexterm><primary>listWidgetClass</primary></indexterm>
19994689c1SmrgClass Name	List
205ec34c4cSmrg<indexterm><primary>List widget</primary><secondary>class name</secondary></indexterm>
21994689c1SmrgSuperclass	Simple
22994689c1Smrg<!-- .sp -->
23994689c1Smrg</literallayout>
24994689c1Smrg</para>
25994689c1Smrg<para>
26994689c1Smrg<!-- .LP -->
27994689c1Smrg
28994689c1SmrgThe List widget contains a list of strings formatted into rows and
29994689c1Smrgcolumns. When one of the strings is selected, it is highlighted, and the
30994689c1SmrgList widget's <function>Notify</function> action is invoked, calling all routines on
31994689c1Smrgits callback list.  Only one string may be selected at a time.
32994689c1Smrg</para>
33421c997bSmrg<sect2 id='List::Resources'>
34994689c1Smrg<title>Resources</title>
35994689c1Smrg<para>
36994689c1Smrg<!-- .LP -->
37994689c1SmrgWhen creating a List widget instance, the following resources are
38994689c1Smrgretrieved from the argument list or from the resource database:
39994689c1Smrg</para>
40994689c1Smrg<para>
41994689c1Smrg<!-- .LP -->
425ec34c4cSmrg<indexterm><primary>List widget</primary><secondary>resources</secondary></indexterm>
43994689c1Smrg<informaltable>
44994689c1Smrg  <tgroup cols='5' align='center'>
45994689c1Smrg  <colspec colname='c1'/>
46994689c1Smrg  <colspec colname='c2'/>
47994689c1Smrg  <colspec colname='c3'/>
48994689c1Smrg  <colspec colname='c4'/>
49994689c1Smrg  <colspec colname='c5'/>
50994689c1Smrg  <thead>
51994689c1Smrg    <row>
52994689c1Smrg      <entry>Name</entry>
53994689c1Smrg      <entry>Class</entry>
54994689c1Smrg      <entry>Type</entry>
55994689c1Smrg      <entry>Notes</entry>
56994689c1Smrg      <entry>Default Value</entry>
57994689c1Smrg    </row>
58994689c1Smrg  </thead>
59994689c1Smrg  <tbody>
60994689c1Smrg    <row>
61994689c1Smrg      <entry>accelerators</entry>
62994689c1Smrg      <entry>Accelerators</entry>
63994689c1Smrg      <entry>AcceleratorTable</entry>
64994689c1Smrg      <entry></entry>
65994689c1Smrg      <entry>NULL</entry>
66994689c1Smrg    </row>
67994689c1Smrg    <row>
68994689c1Smrg      <entry>ancestorSensitive</entry>
69994689c1Smrg      <entry>AncestorSensitive</entry>
70994689c1Smrg      <entry>Boolean</entry>
71994689c1Smrg      <entry>D</entry>
72994689c1Smrg      <entry>True</entry>
73994689c1Smrg    </row>
74994689c1Smrg    <row>
75994689c1Smrg      <entry>background</entry>
76994689c1Smrg      <entry>Background</entry>
77994689c1Smrg      <entry>Pixel</entry>
78994689c1Smrg      <entry></entry>
79994689c1Smrg      <entry>XtDefaultBackground</entry>
80994689c1Smrg    </row>
81994689c1Smrg    <row>
82994689c1Smrg      <entry>backgroundPixmap</entry>
83994689c1Smrg      <entry>Pixmap</entry>
84994689c1Smrg      <entry>Pixmap</entry>
85994689c1Smrg      <entry></entry>
86994689c1Smrg      <entry>XtUnspecifiedPixmap</entry>
87994689c1Smrg    </row>
88994689c1Smrg    <row>
89994689c1Smrg      <entry>borderColor</entry>
90994689c1Smrg      <entry>BorderColor</entry>
91994689c1Smrg      <entry>Pixel</entry>
92994689c1Smrg      <entry></entry>
93994689c1Smrg      <entry>XtDefaultForeground</entry>
94994689c1Smrg    </row>
95994689c1Smrg    <row>
96994689c1Smrg      <entry>borderPixmap</entry>
97994689c1Smrg      <entry>Pixmap</entry>
98994689c1Smrg      <entry>Pixmap</entry>
99994689c1Smrg      <entry></entry>
100994689c1Smrg      <entry>XtUnspecifiedPixmap</entry>
101994689c1Smrg    </row>
102994689c1Smrg    <row>
103994689c1Smrg      <entry>borderWidth</entry>
104994689c1Smrg      <entry>BorderWidth</entry>
105994689c1Smrg      <entry>Dimension</entry>
106994689c1Smrg      <entry></entry>
107994689c1Smrg      <entry>1</entry>
108994689c1Smrg    </row>
109994689c1Smrg    <row>
110994689c1Smrg      <entry>callback</entry>
111994689c1Smrg      <entry>Callback</entry>
112994689c1Smrg      <entry>Callback</entry>
113994689c1Smrg      <entry></entry>
114994689c1Smrg      <entry>NULL</entry>
115994689c1Smrg    </row>
116994689c1Smrg    <row>
117994689c1Smrg      <entry>colormap</entry>
118994689c1Smrg      <entry>Colormap</entry>
119994689c1Smrg      <entry>Colormap</entry>
120994689c1Smrg      <entry></entry>
121994689c1Smrg      <entry>Parent's Colormap</entry>
122994689c1Smrg    </row>
123994689c1Smrg    <row>
124994689c1Smrg      <entry>columnSpacing</entry>
125994689c1Smrg      <entry>Spacing</entry>
126994689c1Smrg      <entry>Dimension</entry>
127994689c1Smrg      <entry></entry>
128994689c1Smrg      <entry>6</entry>
129994689c1Smrg    </row>
130994689c1Smrg    <row>
131994689c1Smrg      <entry>cursor</entry>
132994689c1Smrg      <entry>Cursor</entry>
133994689c1Smrg      <entry>Cursor</entry>
134994689c1Smrg      <entry></entry>
135994689c1Smrg      <entry>XC_left_ptr</entry>
136994689c1Smrg    </row>
137994689c1Smrg    <row>
138994689c1Smrg      <entry>cursorName</entry>
139994689c1Smrg      <entry>Cursor</entry>
140994689c1Smrg      <entry>String</entry>
141994689c1Smrg      <entry></entry>
142994689c1Smrg      <entry>NULL</entry>
143994689c1Smrg    </row>
144994689c1Smrg    <row>
145994689c1Smrg      <entry>defaultColumns</entry>
146994689c1Smrg      <entry>Columns</entry>
147994689c1Smrg      <entry>int</entry>
148994689c1Smrg      <entry></entry>
149994689c1Smrg      <entry>2</entry>
150994689c1Smrg    </row>
151994689c1Smrg    <row>
152994689c1Smrg      <entry>depth</entry>
153994689c1Smrg      <entry>Depth</entry>
154994689c1Smrg      <entry>int</entry>
155994689c1Smrg      <entry>C</entry>
156994689c1Smrg      <entry>Parent's Depth</entry>
157994689c1Smrg    </row>
158994689c1Smrg    <row>
159994689c1Smrg      <entry>destroyCallback</entry>
160994689c1Smrg      <entry>Callback</entry>
161994689c1Smrg      <entry>XtCallbackList</entry>
162994689c1Smrg      <entry></entry>
163994689c1Smrg      <entry>NULL</entry>
164994689c1Smrg    </row>
165994689c1Smrg    <row>
166994689c1Smrg      <entry>font</entry>
167994689c1Smrg      <entry>Font</entry>
168994689c1Smrg      <entry>FontStruct</entry>
169994689c1Smrg      <entry></entry>
170994689c1Smrg      <entry>XtDefaultFont</entry>
171994689c1Smrg    </row>
172994689c1Smrg    <row>
173994689c1Smrg      <entry>fontSet</entry>
174994689c1Smrg      <entry>FontSet</entry>
175994689c1Smrg      <entry>XFontSet</entry>
176994689c1Smrg      <entry></entry>
177994689c1Smrg      <entry>XtDefaultFontSet</entry>
178994689c1Smrg    </row>
179994689c1Smrg    <row>
180994689c1Smrg      <entry>forceColumns</entry>
181994689c1Smrg      <entry>Columns</entry>
182994689c1Smrg      <entry>Boolean</entry>
183994689c1Smrg      <entry></entry>
184994689c1Smrg      <entry>False</entry>
185994689c1Smrg    </row>
186994689c1Smrg    <row>
187994689c1Smrg      <entry>foreground</entry>
188994689c1Smrg      <entry>Foreground</entry>
189994689c1Smrg      <entry>Pixel</entry>
190994689c1Smrg      <entry></entry>
191994689c1Smrg      <entry>XtDefaultForeground</entry>
192994689c1Smrg    </row>
193994689c1Smrg    <row>
194994689c1Smrg      <entry>height</entry>
195994689c1Smrg      <entry>Height</entry>
196994689c1Smrg      <entry>Dimension</entry>
197994689c1Smrg      <entry>A</entry>
198994689c1Smrg      <entry>Enough space to contain the list</entry>
199994689c1Smrg    </row>
200994689c1Smrg    <row>
201994689c1Smrg      <entry>insensitiveBorder</entry>
202994689c1Smrg      <entry>Insensitive</entry>
203994689c1Smrg      <entry>Pixmap</entry>
204994689c1Smrg      <entry></entry>
205994689c1Smrg      <entry>GreyPixmap</entry>
206994689c1Smrg    </row>
207994689c1Smrg    <row>
208994689c1Smrg      <entry>internalHeight</entry>
209994689c1Smrg      <entry>Height</entry>
210994689c1Smrg      <entry>Dimension</entry>
211994689c1Smrg      <entry></entry>
212994689c1Smrg      <entry>2</entry>
213994689c1Smrg    </row>
214994689c1Smrg    <row>
215994689c1Smrg      <entry>internalWidth</entry>
216994689c1Smrg      <entry>Width</entry>
217994689c1Smrg      <entry>Dimension</entry>
218994689c1Smrg      <entry></entry>
219994689c1Smrg      <entry>4</entry>
220994689c1Smrg    </row>
221994689c1Smrg    <row>
222994689c1Smrg      <entry>international</entry>
223994689c1Smrg      <entry>International</entry>
224994689c1Smrg      <entry>Boolean</entry>
225994689c1Smrg      <entry>C</entry>
226994689c1Smrg      <entry>False</entry>
227994689c1Smrg    </row>
228994689c1Smrg    <row>
229994689c1Smrg      <entry>list</entry>
230994689c1Smrg      <entry>List</entry>
231994689c1Smrg      <entry>Pointer</entry>
232994689c1Smrg      <entry></entry>
233994689c1Smrg      <entry>name of widget</entry>
234994689c1Smrg    </row>
235994689c1Smrg    <row>
236994689c1Smrg      <entry>longest</entry>
237994689c1Smrg      <entry>Longest</entry>
238994689c1Smrg      <entry>int</entry>
239994689c1Smrg      <entry>A</entry>
240994689c1Smrg      <entry>0</entry>
241994689c1Smrg    </row>
242994689c1Smrg    <row>
243994689c1Smrg      <entry>mappedWhenManaged</entry>
244994689c1Smrg      <entry>MappedWhenManaged</entry>
245994689c1Smrg      <entry>Boolean</entry>
246994689c1Smrg      <entry></entry>
247994689c1Smrg      <entry>True</entry>
248994689c1Smrg    </row>
249994689c1Smrg    <row>
250994689c1Smrg      <entry>numberStrings</entry>
251994689c1Smrg      <entry>NumberStrings</entry>
252994689c1Smrg      <entry>int</entry>
253994689c1Smrg      <entry>A</entry>
254994689c1Smrg      <entry>computed for NULL terminated list</entry>
255994689c1Smrg    </row>
256994689c1Smrg    <row>
257994689c1Smrg      <entry>pasteBuffer</entry>
258994689c1Smrg      <entry>Boolean</entry>
259994689c1Smrg      <entry>Boolean</entry>
260994689c1Smrg      <entry></entry>
261994689c1Smrg      <entry>False</entry>
262994689c1Smrg    </row>
263994689c1Smrg    <row>
264994689c1Smrg      <entry>pointerColor</entry>
265994689c1Smrg      <entry>Foreground</entry>
266994689c1Smrg      <entry>Pixel</entry>
267994689c1Smrg      <entry></entry>
268994689c1Smrg      <entry>XtDefaultForeground</entry>
269994689c1Smrg    </row>
270994689c1Smrg    <row>
271994689c1Smrg      <entry>pointerColorBackground</entry>
272994689c1Smrg      <entry>Background</entry>
273994689c1Smrg      <entry>Pixel</entry>
274994689c1Smrg      <entry></entry>
275994689c1Smrg      <entry>XtDefaultBackground</entry>
276994689c1Smrg    </row>
277994689c1Smrg    <row>
278994689c1Smrg      <entry>rowSpacing</entry>
279994689c1Smrg      <entry>Spacing</entry>
280994689c1Smrg      <entry>Dimension</entry>
281994689c1Smrg      <entry></entry>
282994689c1Smrg      <entry>2</entry>
283994689c1Smrg    </row>
284994689c1Smrg    <row>
285994689c1Smrg      <entry>screen</entry>
286994689c1Smrg      <entry>Screen</entry>
287994689c1Smrg      <entry>Screen</entry>
288994689c1Smrg      <entry>R</entry>
289994689c1Smrg      <entry>Parent's Screen</entry>
290994689c1Smrg    </row>
291994689c1Smrg    <row>
292994689c1Smrg      <entry>sensitive</entry>
293994689c1Smrg      <entry>Sensitive</entry>
294994689c1Smrg      <entry>Boolean</entry>
295994689c1Smrg      <entry></entry>
296994689c1Smrg      <entry>True</entry>
297994689c1Smrg    </row>
298994689c1Smrg    <row>
299994689c1Smrg      <entry>translations</entry>
300994689c1Smrg      <entry>Translations</entry>
301994689c1Smrg      <entry>TranslationTable</entry>
302994689c1Smrg      <entry></entry>
303994689c1Smrg      <entry>See below</entry>
304994689c1Smrg    </row>
305994689c1Smrg    <row>
306994689c1Smrg      <entry>verticalList</entry>
307994689c1Smrg      <entry>Boolean</entry>
308994689c1Smrg      <entry>Boolean</entry>
309994689c1Smrg      <entry></entry>
310994689c1Smrg      <entry>False</entry>
311994689c1Smrg    </row>
312994689c1Smrg    <row>
313994689c1Smrg      <entry>width</entry>
314994689c1Smrg      <entry>Width</entry>
315994689c1Smrg      <entry>Dimension</entry>
316994689c1Smrg      <entry>A</entry>
317994689c1Smrg      <entry>Enough space to contain the list</entry>
318994689c1Smrg    </row>
319994689c1Smrg    <row>
320994689c1Smrg      <entry>x</entry>
321994689c1Smrg      <entry>Position</entry>
322994689c1Smrg      <entry>Position</entry>
323994689c1Smrg      <entry></entry>
324994689c1Smrg      <entry>0</entry>
325994689c1Smrg    </row>
326994689c1Smrg    <row>
327994689c1Smrg      <entry>y</entry>
328994689c1Smrg      <entry>Position</entry>
329994689c1Smrg      <entry>Position</entry>
330994689c1Smrg      <entry></entry>
331994689c1Smrg      <entry>0</entry>
332994689c1Smrg    </row>
333994689c1Smrg    <row>
334994689c1Smrg      <entry>_</entry>
335994689c1Smrg    </row>
336994689c1Smrg  </tbody>
337994689c1Smrg  </tgroup>
338994689c1Smrg</informaltable>
339994689c1Smrg<!-- .Ac -->
340994689c1Smrg<!-- .As -->
341994689c1Smrg<!-- .Bg -->
342994689c1Smrg<!-- .Gp -->
343994689c1Smrg<!-- .Bc -->
344994689c1Smrg<!-- .Bp -->
345994689c1Smrg<!-- .Bw -->
346994689c1Smrg<variablelist>
347994689c1Smrg  <varlistentry>
348994689c1Smrg    <term>
349994689c1Smrg      <function>callback</function>
350994689c1Smrg    </term>
351994689c1Smrg    <listitem>
352994689c1Smrg      <para>
353994689c1SmrgAll functions on this list are called whenever the <function>notify</function> action is
354994689c1Smrginvoked.  The <emphasis remap='I'>call_data</emphasis> argument contains information about the element
355994689c1Smrgselected and is described in detail in the <function>List Callbacks</function> section.
356994689c1Smrg<!-- .Cm -->
357994689c1Smrg      </para>
358994689c1Smrg    </listitem>
359994689c1Smrg  </varlistentry>
360994689c1Smrg  <varlistentry>
361994689c1Smrg    <term>
362994689c1Smrg      <function>columnSpacing</function>
363994689c1Smrg    </term>
364994689c1Smrg    <listitem>
365994689c1Smrg      <para>
366994689c1Smrg<!-- .br -->
367994689c1Smrg<!-- .ns -->
368994689c1Smrg      </para>
369994689c1Smrg    </listitem>
370994689c1Smrg  </varlistentry>
371994689c1Smrg  <varlistentry>
372994689c1Smrg    <term>
373994689c1Smrg      <function>rowSpacing</function>
374994689c1Smrg    </term>
375994689c1Smrg    <listitem>
376994689c1Smrg      <para>
377994689c1SmrgThe amount of space, in pixels, between each of the rows and columns
378994689c1Smrgin the list.
379994689c1Smrg<!-- .Cu -->
380994689c1Smrg<!-- .Cn -->
381994689c1Smrg      </para>
382994689c1Smrg    </listitem>
383994689c1Smrg  </varlistentry>
384994689c1Smrg  <varlistentry>
385994689c1Smrg    <term>
386994689c1Smrg      <function>defaultColumns</function>
387994689c1Smrg    </term>
388994689c1Smrg    <listitem>
389994689c1Smrg      <para>
390994689c1SmrgThe default number of columns.  This value is used when neither the
391994689c1Smrgwidth nor the height of the List widget is specified or when
392994689c1Smrg<function>forceColumns</function> is <function>True</function>.
393994689c1Smrg<!-- .Dp -->
394994689c1Smrg<!-- .Dc -->
395994689c1Smrg      </para>
396994689c1Smrg    </listitem>
397994689c1Smrg  </varlistentry>
398994689c1Smrg  <varlistentry>
399994689c1Smrg    <term>
400994689c1Smrg      <function>font</function>
401994689c1Smrg    </term>
402994689c1Smrg    <listitem>
403994689c1Smrg      <para>
404994689c1SmrgThe text font to use when displaying the <function>list</function>, when the
405994689c1Smrg<function>international</function> resource is <function>false</function>.
406994689c1Smrg      </para>
407994689c1Smrg    </listitem>
408994689c1Smrg  </varlistentry>
409994689c1Smrg  <varlistentry>
410994689c1Smrg    <term>
411994689c1Smrg      <function>fontSet</function>
412994689c1Smrg    </term>
413994689c1Smrg    <listitem>
414994689c1Smrg      <para>
415994689c1SmrgThe text font set to use when displaying the <function>list</function>, when the
416994689c1Smrg<function>international</function> resource is <function>true</function>.
417994689c1Smrg      </para>
418994689c1Smrg    </listitem>
419994689c1Smrg  </varlistentry>
420994689c1Smrg  <varlistentry>
421994689c1Smrg    <term>
422994689c1Smrg      <function>forceColumns</function>
423994689c1Smrg    </term>
424994689c1Smrg    <listitem>
425994689c1Smrg      <para>
426994689c1SmrgForces the default number of columns to be used regardless of the
427994689c1SmrgList widget's current size.
428994689c1Smrg      </para>
429994689c1Smrg    </listitem>
430994689c1Smrg  </varlistentry>
431994689c1Smrg  <varlistentry>
432994689c1Smrg    <term>
433994689c1Smrg      <function>foreground</function>
434994689c1Smrg    </term>
435994689c1Smrg    <listitem>
436994689c1Smrg      <para>
437994689c1SmrgA pixel value which indexes the widget's colormap to derive the color
438994689c1Smrgused to paint the text of the list elements.
439994689c1Smrg<!-- .Hw -->
440994689c1Smrg<!-- .Ib -->
441994689c1Smrg      </para>
442994689c1Smrg    </listitem>
443994689c1Smrg  </varlistentry>
444994689c1Smrg  <varlistentry>
445994689c1Smrg    <term>
4465ec34c4cSmrg      <function>internalHeight</function>
447994689c1Smrg    </term>
448994689c1Smrg    <listitem>
449994689c1Smrg      <para>
450994689c1Smrg<!-- .br -->
451994689c1Smrg<!-- .ns -->
452994689c1Smrg      </para>
453994689c1Smrg    </listitem>
454994689c1Smrg  </varlistentry>
455994689c1Smrg  <varlistentry>
456994689c1Smrg    <term>
4575ec34c4cSmrg      <function>internalWidth</function>
458994689c1Smrg    </term>
459994689c1Smrg    <listitem>
460994689c1Smrg      <para>
461994689c1SmrgThe margin, in pixels, between the edges of the list and the
462994689c1Smrgcorresponding edge of the List widget's window.
463994689c1Smrg      </para>
464994689c1Smrg    </listitem>
465994689c1Smrg  </varlistentry>
466994689c1Smrg  <varlistentry>
467994689c1Smrg    <term>
468994689c1Smrg      <function>list</function>
469994689c1Smrg    </term>
470994689c1Smrg    <listitem>
471994689c1Smrg      <para>
472994689c1SmrgAn array of text strings displayed in the List widget.  If
473994689c1Smrg<function>numberStrings</function> is zero (the default) then the <function>list</function> must be
474994689c1SmrgNULL terminated.  If a value is not specified for the <function>list</function>, then
475994689c1Smrg<function>numberStrings</function> is set to 1, and the name of the widget is used as
476994689c1Smrgthe <function>list</function>, and <function>longest</function> is set to the length of the name of the
477994689c1Smrgwidget.  The <function>list</function> is used in place, and must be available
478994689c1Smrgto the List widget for the lifetime of this widget, or until it is
479421c997bSmrgchanged with <xref linkend='XtSetValues' xrefstyle='select: title'/> or <xref linkend='XawListChange' xrefstyle='select: title'/>.
480994689c1Smrg<!-- .In -->
481994689c1Smrg      </para>
482994689c1Smrg    </listitem>
483994689c1Smrg  </varlistentry>
484994689c1Smrg  <varlistentry>
485994689c1Smrg    <term>
486994689c1Smrg      <function>longest</function>
487994689c1Smrg    </term>
488994689c1Smrg    <listitem>
489994689c1Smrg      <para>
490994689c1SmrgSpecifies the width, in pixels, of the longest string in the current
491994689c1Smrglist.  The List widget will compute this value if zero (the default)
492994689c1Smrgis specified.  If this resource is set by hand, entries longer than this
493994689c1Smrgwill be clipped to fit.
494994689c1Smrg<!-- .Mm -->
495994689c1Smrg      </para>
496994689c1Smrg    </listitem>
497994689c1Smrg  </varlistentry>
498994689c1Smrg  <varlistentry>
499994689c1Smrg    <term>
500994689c1Smrg      <function>numberStrings</function>
501994689c1Smrg    </term>
502994689c1Smrg    <listitem>
503994689c1Smrg      <para>
504994689c1SmrgThe number of strings in the current list.  If a value of zero (the
505994689c1Smrgdefault) is specified, the List widget will compute it.  When computing
506994689c1Smrgthe number of strings the List widget assumes that the <function>list</function> is NULL
507994689c1Smrgterminated.
508994689c1Smrg      </para>
509994689c1Smrg    </listitem>
510994689c1Smrg  </varlistentry>
511994689c1Smrg  <varlistentry>
512994689c1Smrg    <term>
513994689c1Smrg      <function>pasteBuffer</function>
514994689c1Smrg    </term>
515994689c1Smrg    <listitem>
516994689c1Smrg      <para>
517994689c1SmrgIf this resource is set to <function>True</function> then the name of the currently
518994689c1Smrgselected list element will be put into <function>CUT_BUFFER_0</function>.
519994689c1Smrg<!-- .Pf -->
520994689c1Smrg<!-- .Pb -->
521994689c1Smrg<!-- .Sc -->
522994689c1Smrg<!-- .Se -->
523994689c1Smrg<!-- .Tr -->
524994689c1Smrg      </para>
525994689c1Smrg    </listitem>
526994689c1Smrg  </varlistentry>
527994689c1Smrg  <varlistentry>
528994689c1Smrg    <term>
529994689c1Smrg      <function>verticalList</function>
530994689c1Smrg    </term>
531994689c1Smrg    <listitem>
532994689c1Smrg      <para>
533994689c1SmrgIf this resource is set to <function>True</function> then the list elements will be
534994689c1Smrgpresented in column major order.
535994689c1Smrg<!-- .Xy -->
536994689c1Smrg    </para>
537994689c1Smrg  </listitem>
538994689c1Smrg  </varlistentry>
539994689c1Smrg</variablelist>
540994689c1Smrg</para>
541994689c1Smrg</sect2>
542994689c1Smrg<sect2 id="List_Actions">
543994689c1Smrg<title>List Actions</title>
5445ec34c4cSmrg<indexterm><primary>List widget</primary><secondary>actions</secondary></indexterm>
545994689c1Smrg<para>
546994689c1Smrg<!-- .LP -->
547994689c1SmrgThe List widget supports the following actions:
548994689c1Smrg</para>
549994689c1Smrg<itemizedlist>
550994689c1Smrg  <listitem>
551994689c1Smrg    <para>
552994689c1SmrgHighlighting and unhighlighting the list element under the
553994689c1Smrgpointer with <function>Set</function> and <function>Unset</function>
554994689c1Smrg    </para>
555994689c1Smrg  </listitem>
556994689c1Smrg  <listitem>
557994689c1Smrg    <para>
558994689c1SmrgProcessing application callbacks with <function>Notify</function>
559994689c1Smrg    </para>
560994689c1Smrg  </listitem>
561994689c1Smrg</itemizedlist>
562994689c1Smrg<para>
563994689c1Smrg<!-- .LP -->
564994689c1SmrgThe following is the default translation table used by the List Widget:
5655ec34c4cSmrg<indexterm><primary>List widget</primary><secondary>default translation table</secondary></indexterm>
566994689c1Smrg</para>
567994689c1Smrg<para>
568994689c1Smrg<!-- .LP -->
569994689c1Smrg<literallayout class="monospaced">
570994689c1Smrg<!-- .TA .5i 2.25i -->
571994689c1Smrg<!-- .ta .5i 2.25i -->
5725ec34c4cSmrg&lt;Btn1Down&gt;,&lt;Btn1Up&gt;:	Set(&#x2006;) Notify(&#x2006;)
573994689c1Smrg<!-- .sp -->
574994689c1Smrg</literallayout>
575994689c1Smrg</para>
576994689c1Smrg<para>
577994689c1Smrg<!-- .LP -->
578994689c1SmrgThe full list of actions supported by List widget is:
579994689c1Smrg<variablelist>
580994689c1Smrg  <varlistentry>
581994689c1Smrg    <term>
5825ec34c4cSmrg      <function>Set</function>(&#x2006;)
583994689c1Smrg    </term>
584994689c1Smrg    <listitem>
585994689c1Smrg      <para>
586994689c1Smrg<emphasis remap='I'>Sets</emphasis> the list element that is currently under the pointer.  To
587994689c1Smrginform the user that this element is currently set, it is drawn with
588994689c1Smrgforeground and background colors reversed.  If this action is called when
589994689c1Smrgthere is no list element under the cursor, the currently <emphasis remap='I'>set</emphasis>
590994689c1Smrgelement will be <emphasis remap='I'>unset</emphasis>.
591994689c1Smrg      </para>
592994689c1Smrg    </listitem>
593994689c1Smrg  </varlistentry>
594994689c1Smrg  <varlistentry>
595994689c1Smrg    <term>
5965ec34c4cSmrg      <function>Unset</function>(&#x2006;)
597994689c1Smrg    </term>
598994689c1Smrg    <listitem>
599994689c1Smrg      <para>
600994689c1SmrgCancels the <emphasis remap='I'>set</emphasis> state of the element under the pointer,
601994689c1Smrgand redraws it with normal foreground and background colors.
602994689c1Smrg      </para>
603994689c1Smrg    </listitem>
604994689c1Smrg  </varlistentry>
605994689c1Smrg  <varlistentry>
606994689c1Smrg    <term>
6075ec34c4cSmrg      <function>Notify</function>(&#x2006;)
608994689c1Smrg    </term>
609994689c1Smrg    <listitem>
610994689c1Smrg      <para>
611994689c1SmrgCalls all callbacks on the List widget's callback list.  Information
612994689c1Smrgabout the currently selected list element is passed in the
613994689c1Smrg<emphasis remap='I'>call_data</emphasis> argument (see <function>List Callbacks</function> below).
614994689c1Smrg    </para>
615994689c1Smrg  </listitem>
616994689c1Smrg  </varlistentry>
617994689c1Smrg</variablelist>
618994689c1Smrg</para>
619994689c1Smrg</sect2>
620994689c1Smrg<sect2 id="List_Callbacks">
621994689c1Smrg<title>List Callbacks</title>
6225ec34c4cSmrg<indexterm><primary>List widget</primary><secondary>callbacks</secondary></indexterm>
623994689c1Smrg<para>
624994689c1Smrg<!-- .LP -->
625994689c1SmrgAll procedures on the List widget's callback list will have a
626994689c1Smrg<function>XawListReturnStruct</function> passed to them as <emphasis remap='I'>call_data</emphasis>.  The
627994689c1Smrgstructure is defined in the List widget's application header file.
628994689c1Smrg</para>
629994689c1Smrg<!-- .LP -->
630994689c1Smrg<literallayout class="monospaced">
631994689c1Smrg<!-- .TA .5i 2.25i -->
632994689c1Smrg<!-- .ta .5i 2.25i -->
6335ec34c4cSmrg<indexterm significance="preferred"><primary>XawListReturnStruct</primary></indexterm>
634994689c1Smrgtypedef struct _XawListReturnStruct {
635994689c1Smrg	String string;	/* string shown in the list. */
636994689c1Smrg	int list_index;	/* index of the item selected. */
637994689c1Smrg} XawListReturnStruct;
6385ec34c4cSmrg<indexterm><primary>XawListReturnStruct</primary></indexterm>
639994689c1Smrg<!-- .NT -->
640994689c1Smrg</literallayout>
641994689c1Smrg<note><para>
642994689c1SmrgThe <emphasis remap='I'>list_index</emphasis> item used to be called simply <emphasis remap='I'>index</emphasis>.
643994689c1SmrgUnfortunately, this name collided with a global name defined on some
644994689c1Smrgoperating systems, and had to be changed.
645994689c1Smrg</para></note>
646994689c1Smrg<!-- .NE -->
647994689c1Smrg</sect2>
648994689c1Smrg<sect2 id="Changing_the_List">
649994689c1Smrg<title>Changing the List</title>
650994689c1Smrg<para>
651994689c1Smrg<!-- .LP -->
652994689c1SmrgTo change the list that is displayed, use
6535ec34c4cSmrg<function>XawListChange</function>.
6545ec34c4cSmrg<indexterm significance="preferred"><primary>XawListChange</primary></indexterm>
655421c997bSmrg<funcsynopsis id='XawListChange'>
656994689c1Smrg<funcprototype>
657994689c1Smrg  <funcdef>void<function> XawListChange</function></funcdef>
658994689c1Smrg  <paramdef>Widget<parameter> w</parameter></paramdef>
659994689c1Smrg  <paramdef>String*<parameter> list</parameter></paramdef>
660994689c1Smrg  <paramdef>intnitems,<parameter> longest</parameter></paramdef>
661994689c1Smrg  <paramdef>Boolean<parameter> resize</parameter></paramdef>
662994689c1Smrg</funcprototype>
663994689c1Smrg</funcsynopsis>
664994689c1Smrg<!-- .FN -->
665994689c1Smrg<variablelist>
666994689c1Smrg  <varlistentry>
667994689c1Smrg    <term>
668994689c1Smrg      <emphasis remap='I'>w</emphasis>
669994689c1Smrg    </term>
670994689c1Smrg    <listitem>
671994689c1Smrg      <para>
672994689c1SmrgSpecifies the List widget.
673994689c1Smrg      </para>
674994689c1Smrg    </listitem>
675994689c1Smrg  </varlistentry>
676994689c1Smrg  <varlistentry>
677994689c1Smrg    <term>
678994689c1Smrg      <emphasis remap='I'>list</emphasis>
679994689c1Smrg    </term>
680994689c1Smrg    <listitem>
681994689c1Smrg      <para>
682994689c1SmrgSpecifies the new list for the List widget to display.
683994689c1Smrg      </para>
684994689c1Smrg    </listitem>
685994689c1Smrg  </varlistentry>
686994689c1Smrg  <varlistentry>
687994689c1Smrg    <term>
688994689c1Smrg      <emphasis remap='I'>nitems</emphasis>
689994689c1Smrg    </term>
690994689c1Smrg    <listitem>
691994689c1Smrg      <para>
692994689c1SmrgSpecifies the number of items in the <emphasis remap='I'>list</emphasis>.  If a value less than 1
693994689c1Smrgis specified, <emphasis remap='I'>list</emphasis> must be NULL terminated, and the number of
694994689c1Smrgitems will be calculated by the List widget.
695994689c1Smrg      </para>
696994689c1Smrg    </listitem>
697994689c1Smrg  </varlistentry>
698994689c1Smrg  <varlistentry>
699994689c1Smrg    <term>
700994689c1Smrg      <emphasis remap='I'>longest</emphasis>
701994689c1Smrg    </term>
702994689c1Smrg    <listitem>
703994689c1Smrg      <para>
704994689c1SmrgSpecifies the length of the longest item in the <emphasis remap='I'>list</emphasis> in pixels.
705994689c1SmrgIf a value less than 1 is specified, the List widget will calculate the
706994689c1Smrgvalue.
707994689c1Smrg      </para>
708994689c1Smrg    </listitem>
709994689c1Smrg  </varlistentry>
710994689c1Smrg  <varlistentry>
711994689c1Smrg    <term>
712994689c1Smrg      <emphasis remap='I'>resize</emphasis>
713994689c1Smrg    </term>
714994689c1Smrg    <listitem>
715994689c1Smrg      <para>
716994689c1SmrgSpecifies a Boolean value that if <function>True</function> indicates that the
717994689c1SmrgList widget should try to resize itself after making the change.
718994689c1SmrgThe constraints of the List widget's parent are always enforced,
719994689c1Smrgregardless of the value specified here.
720994689c1Smrg    </para>
721994689c1Smrg  </listitem>
722994689c1Smrg  </varlistentry>
723994689c1Smrg</variablelist>
724994689c1Smrg</para>
725994689c1Smrg<para>
726994689c1Smrg<!-- .LP -->
727421c997bSmrg<xref linkend='XawListChange' xrefstyle='select: title'/>
728994689c1Smrgwill <emphasis remap='I'>unset</emphasis> all list elements that are currently <function>set</function> before
729994689c1Smrgthe list is actually changed.  The <emphasis remap='I'>list</emphasis> is used in place, and must
730994689c1Smrgremain usable for the lifetime of the List widget, or until <emphasis remap='I'>list</emphasis>
731421c997bSmrghas been changed again with this function or with <xref linkend='XtSetValues' xrefstyle='select: title'/>.
732994689c1Smrg</para>
733994689c1Smrg</sect2>
734994689c1Smrg<sect2 id="Highlighting_an_Item">
735994689c1Smrg<title>Highlighting an Item</title>
736994689c1Smrg<para>
737994689c1Smrg<!-- .LP -->
738994689c1SmrgTo highlight an item in the list, use
7395ec34c4cSmrg<function>XawListHighlight</function>.
7405ec34c4cSmrg<indexterm significance="preferred"><primary>XawListHighlight</primary></indexterm>
741421c997bSmrg<funcsynopsis id='XawListHighlight'>
742994689c1Smrg<funcprototype>
743994689c1Smrg  <funcdef>void<function> XawListHighlight</function></funcdef>
744994689c1Smrg  <paramdef>Widget<parameter> w</parameter></paramdef>
745994689c1Smrg  <paramdef>int<parameter> item</parameter></paramdef>
746994689c1Smrg</funcprototype>
747994689c1Smrg</funcsynopsis>
748994689c1Smrg<!-- .FN -->
749994689c1Smrg<variablelist>
750994689c1Smrg  <varlistentry>
751994689c1Smrg    <term>
752994689c1Smrg      <emphasis remap='I'>w</emphasis>
753994689c1Smrg    </term>
754994689c1Smrg    <listitem>
755994689c1Smrg      <para>
756994689c1SmrgSpecifies the List widget.
757994689c1Smrg      </para>
758994689c1Smrg    </listitem>
759994689c1Smrg  </varlistentry>
760994689c1Smrg  <varlistentry>
761994689c1Smrg    <term>
762994689c1Smrg      <emphasis remap='I'>item</emphasis>
763994689c1Smrg    </term>
764994689c1Smrg    <listitem>
765994689c1Smrg      <para>
766994689c1SmrgSpecifies an index into the current list that indicates the item to be
767994689c1Smrghighlighted.
768994689c1Smrg    </para>
769994689c1Smrg  </listitem>
770994689c1Smrg  </varlistentry>
771994689c1Smrg</variablelist>
772994689c1Smrg</para>
773994689c1Smrg<para>
774994689c1Smrg<!-- .LP -->
775994689c1SmrgOnly one item can be highlighted at a time.
776994689c1SmrgIf an item is already highlighted when
777421c997bSmrg<xref linkend='XawListHighlight' xrefstyle='select: title'/>
778994689c1Smrgis called,
779994689c1Smrgthe highlighted item is unhighlighted before the new item is highlighted.
780994689c1Smrg</para>
781994689c1Smrg</sect2>
782994689c1Smrg<sect2 id="Unhighlighting_an_Item">
783994689c1Smrg<title>Unhighlighting an Item</title>
784994689c1Smrg<para>
785994689c1Smrg<!-- .LP -->
786994689c1SmrgTo unhighlight the currently highlighted item in the list, use
7875ec34c4cSmrg<function>XawListUnhighlight</function>.
7885ec34c4cSmrg<indexterm significance="preferred"><primary>XawListUnhighlight</primary></indexterm>
789421c997bSmrg<funcsynopsis id='XawListUnhighlight'>
790994689c1Smrg<funcprototype>
791994689c1Smrg  <funcdef>void<function> XawListUnhighlight</function></funcdef>
792994689c1Smrg  <paramdef>Widget<parameter> w</parameter></paramdef>
793994689c1Smrg</funcprototype>
794994689c1Smrg</funcsynopsis>
795994689c1Smrg<!-- .FN -->
796994689c1Smrg<variablelist>
797994689c1Smrg  <varlistentry>
798994689c1Smrg    <term>
799994689c1Smrg      <emphasis remap='I'>w</emphasis>
800994689c1Smrg    </term>
801994689c1Smrg    <listitem>
802994689c1Smrg      <para>
803994689c1SmrgSpecifies the List widget.
804994689c1Smrg    </para>
805994689c1Smrg  </listitem>
806994689c1Smrg  </varlistentry>
807994689c1Smrg</variablelist>
808994689c1Smrg</para>
809994689c1Smrg</sect2>
810994689c1Smrg<sect2 id="Retrieving_the_Currently_Selected_Item">
811994689c1Smrg<title>Retrieving the Currently Selected Item</title>
812994689c1Smrg<para>
813994689c1Smrg<!-- .LP -->
814994689c1SmrgTo retrieve the list element that is currently <emphasis remap='I'>set</emphasis>, use
8155ec34c4cSmrg<function>XawListShowCurrent</function>.
8165ec34c4cSmrg<indexterm significance="preferred"><primary>XawListShowCurrent</primary></indexterm>
817421c997bSmrg<funcsynopsis id='XawListShowCurrent'>
818994689c1Smrg<funcprototype>
819994689c1Smrg  <funcdef>XawListReturnStruct<function> *XawListShowCurrent</function></funcdef>
820994689c1Smrg  <paramdef>Widget<parameter> w</parameter></paramdef>
821994689c1Smrg</funcprototype>
822994689c1Smrg</funcsynopsis>
823994689c1Smrg<!-- .FN -->
824994689c1Smrg<variablelist>
825994689c1Smrg  <varlistentry>
826994689c1Smrg    <term>
827994689c1Smrg      <emphasis remap='I'>w</emphasis>
828994689c1Smrg    </term>
829994689c1Smrg    <listitem>
830994689c1Smrg      <para>
831994689c1SmrgSpecifies the List widget.
832994689c1Smrg    </para>
833994689c1Smrg  </listitem>
834994689c1Smrg  </varlistentry>
835994689c1Smrg</variablelist>
836994689c1Smrg</para>
837994689c1Smrg<para>
838994689c1Smrg<!-- .LP -->
839994689c1Smrg<function>XawListShowCurrent</function>
840994689c1Smrgreturns a pointer to an
841994689c1Smrg<function>XawListReturnStruct</function>
842994689c1Smrgstructure,
843994689c1Smrgcontaining the currently highlighted item.
844994689c1SmrgIf the value of the index member is XAW_LIST_NONE,
8455ec34c4cSmrg<indexterm><primary>XAW_LIST_NONE</primary></indexterm>
846994689c1Smrgthe string member is undefined, and no item is currently selected.
847994689c1Smrg</para>
848994689c1Smrg</sect2>
849994689c1Smrg<sect2 id="Restrictions">
850994689c1Smrg<title>Restrictions</title>
851994689c1Smrg<para>
852994689c1Smrg<!-- .LP -->
8535ec34c4cSmrgMany programmers create a <quote>scrolled list</quote> by putting a List
854994689c1Smrgwidget with many entries as a child of a Viewport widget.  The
855994689c1SmrgList continues to create a window as big as its contents, but
856994689c1Smrgthat big window is only visible where it intersects the parent
8575ec34c4cSmrgViewport's window.  (I.e., it is <quote>clipped.</quote>)
858994689c1Smrg</para>
859994689c1Smrg<para>
860994689c1Smrg<!-- .LP -->
861994689c1SmrgWhile this is a useful technique, there is a serious drawback.
862994689c1SmrgX does not support windows above 32,767 pixels in width or
863994689c1Smrgheight, but this height limit will be exceeded by a List's
864994689c1Smrgwindow when the List has many entries (i.e., with a 12 point
865994689c1Smrgfont, about 3000 entries would be too many.)
866994689c1Smrg</para>
867994689c1Smrg<para>
868994689c1Smrg<!-- .LP -->
869994689c1Smrg
870994689c1Smrg</para>
871994689c1Smrg</sect2>
872994689c1Smrg</sect1>
873