summaryrefslogtreecommitdiff
path: root/lib/libXaw/specs/List.xml
blob: acf20cbcd94fe02688add5480e86d0c7da464a44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
<sect1 id="List_Widget">
<title>List Widget</title>
<para>
<!-- .LP -->
<!-- .XS -->
<!-- 	List Widget -->
<!-- .XE -->
<indexterm significance="preferred"><primary>List widget</primary></indexterm>
<literallayout class="monospaced">
<!-- .TA 2.0i -->
<!-- .ta 2.0i -->
<!-- .sp -->
Application header file	&lt;X11/Xaw/List.h&gt;
<indexterm><primary>List.h</primary></indexterm>
Class header file	&lt;X11/Xaw/ListP.h&gt;
<indexterm><primary>ListP.h</primary></indexterm>
Class	listWidgetClass
<indexterm><primary>listWidgetClass</primary></indexterm>
Class Name	List
<indexterm><primary>List widget</primary><secondary>class name</secondary></indexterm>
Superclass	Simple
<!-- .sp -->
</literallayout>
</para>
<para>
<!-- .LP -->

The List widget contains a list of strings formatted into rows and
columns. When one of the strings is selected, it is highlighted, and the
List widget's <function>Notify</function> action is invoked, calling all routines on
its callback list.  Only one string may be selected at a time.
</para>
<sect2 id='List::Resources'>
<title>Resources</title>
<para>
<!-- .LP -->
When creating a List widget instance, the following resources are
retrieved from the argument list or from the resource database:
</para>
<para>
<!-- .LP -->
<indexterm><primary>List widget</primary><secondary>resources</secondary></indexterm>
<informaltable>
  <tgroup cols='5' align='center'>
  <colspec colname='c1'/>
  <colspec colname='c2'/>
  <colspec colname='c3'/>
  <colspec colname='c4'/>
  <colspec colname='c5'/>
  <thead>
    <row>
      <entry>Name</entry>
      <entry>Class</entry>
      <entry>Type</entry>
      <entry>Notes</entry>
      <entry>Default Value</entry>
    </row>
  </thead>
  <tbody>
    <row>
      <entry>accelerators</entry>
      <entry>Accelerators</entry>
      <entry>AcceleratorTable</entry>
      <entry></entry>
      <entry>NULL</entry>
    </row>
    <row>
      <entry>ancestorSensitive</entry>
      <entry>AncestorSensitive</entry>
      <entry>Boolean</entry>
      <entry>D</entry>
      <entry>True</entry>
    </row>
    <row>
      <entry>background</entry>
      <entry>Background</entry>
      <entry>Pixel</entry>
      <entry></entry>
      <entry>XtDefaultBackground</entry>
    </row>
    <row>
      <entry>backgroundPixmap</entry>
      <entry>Pixmap</entry>
      <entry>Pixmap</entry>
      <entry></entry>
      <entry>XtUnspecifiedPixmap</entry>
    </row>
    <row>
      <entry>borderColor</entry>
      <entry>BorderColor</entry>
      <entry>Pixel</entry>
      <entry></entry>
      <entry>XtDefaultForeground</entry>
    </row>
    <row>
      <entry>borderPixmap</entry>
      <entry>Pixmap</entry>
      <entry>Pixmap</entry>
      <entry></entry>
      <entry>XtUnspecifiedPixmap</entry>
    </row>
    <row>
      <entry>borderWidth</entry>
      <entry>BorderWidth</entry>
      <entry>Dimension</entry>
      <entry></entry>
      <entry>1</entry>
    </row>
    <row>
      <entry>callback</entry>
      <entry>Callback</entry>
      <entry>Callback</entry>
      <entry></entry>
      <entry>NULL</entry>
    </row>
    <row>
      <entry>colormap</entry>
      <entry>Colormap</entry>
      <entry>Colormap</entry>
      <entry></entry>
      <entry>Parent's Colormap</entry>
    </row>
    <row>
      <entry>columnSpacing</entry>
      <entry>Spacing</entry>
      <entry>Dimension</entry>
      <entry></entry>
      <entry>6</entry>
    </row>
    <row>
      <entry>cursor</entry>
      <entry>Cursor</entry>
      <entry>Cursor</entry>
      <entry></entry>
      <entry>XC_left_ptr</entry>
    </row>
    <row>
      <entry>cursorName</entry>
      <entry>Cursor</entry>
      <entry>String</entry>
      <entry></entry>
      <entry>NULL</entry>
    </row>
    <row>
      <entry>defaultColumns</entry>
      <entry>Columns</entry>
      <entry>int</entry>
      <entry></entry>
      <entry>2</entry>
    </row>
    <row>
      <entry>depth</entry>
      <entry>Depth</entry>
      <entry>int</entry>
      <entry>C</entry>
      <entry>Parent's Depth</entry>
    </row>
    <row>
      <entry>destroyCallback</entry>
      <entry>Callback</entry>
      <entry>XtCallbackList</entry>
      <entry></entry>
      <entry>NULL</entry>
    </row>
    <row>
      <entry>font</entry>
      <entry>Font</entry>
      <entry>FontStruct</entry>
      <entry></entry>
      <entry>XtDefaultFont</entry>
    </row>
    <row>
      <entry>fontSet</entry>
      <entry>FontSet</entry>
      <entry>XFontSet</entry>
      <entry></entry>
      <entry>XtDefaultFontSet</entry>
    </row>
    <row>
      <entry>forceColumns</entry>
      <entry>Columns</entry>
      <entry>Boolean</entry>
      <entry></entry>
      <entry>False</entry>
    </row>
    <row>
      <entry>foreground</entry>
      <entry>Foreground</entry>
      <entry>Pixel</entry>
      <entry></entry>
      <entry>XtDefaultForeground</entry>
    </row>
    <row>
      <entry>height</entry>
      <entry>Height</entry>
      <entry>Dimension</entry>
      <entry>A</entry>
      <entry>Enough space to contain the list</entry>
    </row>
    <row>
      <entry>insensitiveBorder</entry>
      <entry>Insensitive</entry>
      <entry>Pixmap</entry>
      <entry></entry>
      <entry>GreyPixmap</entry>
    </row>
    <row>
      <entry>internalHeight</entry>
      <entry>Height</entry>
      <entry>Dimension</entry>
      <entry></entry>
      <entry>2</entry>
    </row>
    <row>
      <entry>internalWidth</entry>
      <entry>Width</entry>
      <entry>Dimension</entry>
      <entry></entry>
      <entry>4</entry>
    </row>
    <row>
      <entry>international</entry>
      <entry>International</entry>
      <entry>Boolean</entry>
      <entry>C</entry>
      <entry>False</entry>
    </row>
    <row>
      <entry>list</entry>
      <entry>List</entry>
      <entry>Pointer</entry>
      <entry></entry>
      <entry>name of widget</entry>
    </row>
    <row>
      <entry>longest</entry>
      <entry>Longest</entry>
      <entry>int</entry>
      <entry>A</entry>
      <entry>0</entry>
    </row>
    <row>
      <entry>mappedWhenManaged</entry>
      <entry>MappedWhenManaged</entry>
      <entry>Boolean</entry>
      <entry></entry>
      <entry>True</entry>
    </row>
    <row>
      <entry>numberStrings</entry>
      <entry>NumberStrings</entry>
      <entry>int</entry>
      <entry>A</entry>
      <entry>computed for NULL terminated list</entry>
    </row>
    <row>
      <entry>pasteBuffer</entry>
      <entry>Boolean</entry>
      <entry>Boolean</entry>
      <entry></entry>
      <entry>False</entry>
    </row>
    <row>
      <entry>pointerColor</entry>
      <entry>Foreground</entry>
      <entry>Pixel</entry>
      <entry></entry>
      <entry>XtDefaultForeground</entry>
    </row>
    <row>
      <entry>pointerColorBackground</entry>
      <entry>Background</entry>
      <entry>Pixel</entry>
      <entry></entry>
      <entry>XtDefaultBackground</entry>
    </row>
    <row>
      <entry>rowSpacing</entry>
      <entry>Spacing</entry>
      <entry>Dimension</entry>
      <entry></entry>
      <entry>2</entry>
    </row>
    <row>
      <entry>screen</entry>
      <entry>Screen</entry>
      <entry>Screen</entry>
      <entry>R</entry>
      <entry>Parent's Screen</entry>
    </row>
    <row>
      <entry>sensitive</entry>
      <entry>Sensitive</entry>
      <entry>Boolean</entry>
      <entry></entry>
      <entry>True</entry>
    </row>
    <row>
      <entry>translations</entry>
      <entry>Translations</entry>
      <entry>TranslationTable</entry>
      <entry></entry>
      <entry>See below</entry>
    </row>
    <row>
      <entry>verticalList</entry>
      <entry>Boolean</entry>
      <entry>Boolean</entry>
      <entry></entry>
      <entry>False</entry>
    </row>
    <row>
      <entry>width</entry>
      <entry>Width</entry>
      <entry>Dimension</entry>
      <entry>A</entry>
      <entry>Enough space to contain the list</entry>
    </row>
    <row>
      <entry>x</entry>
      <entry>Position</entry>
      <entry>Position</entry>
      <entry></entry>
      <entry>0</entry>
    </row>
    <row>
      <entry>y</entry>
      <entry>Position</entry>
      <entry>Position</entry>
      <entry></entry>
      <entry>0</entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>
<!-- .Ac -->
<!-- .As -->
<!-- .Bg -->
<!-- .Gp -->
<!-- .Bc -->
<!-- .Bp -->
<!-- .Bw -->
<variablelist>
  <varlistentry>
    <term>
      <function>callback</function>
    </term>
    <listitem>
      <para>
All functions on this list are called whenever the <function>notify</function> action is
invoked.  The <emphasis remap='I'>call_data</emphasis> argument contains information about the element
selected and is described in detail in the <function>List Callbacks</function> section.
<!-- .Cm -->
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>columnSpacing</function>
    </term>
    <listitem>
      <para>
<!-- .br -->
<!-- .ns -->
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>rowSpacing</function>
    </term>
    <listitem>
      <para>
The amount of space, in pixels, between each of the rows and columns
in the list.
<!-- .Cu -->
<!-- .Cn -->
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>defaultColumns</function>
    </term>
    <listitem>
      <para>
The default number of columns.  This value is used when neither the
width nor the height of the List widget is specified or when
<function>forceColumns</function> is <function>True</function>.
<!-- .Dp -->
<!-- .Dc -->
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>font</function>
    </term>
    <listitem>
      <para>
The text font to use when displaying the <function>list</function>, when the
<function>international</function> resource is <function>false</function>.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>fontSet</function>
    </term>
    <listitem>
      <para>
The text font set to use when displaying the <function>list</function>, when the
<function>international</function> resource is <function>true</function>.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>forceColumns</function>
    </term>
    <listitem>
      <para>
Forces the default number of columns to be used regardless of the
List widget's current size.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>foreground</function>
    </term>
    <listitem>
      <para>
A pixel value which indexes the widget's colormap to derive the color
used to paint the text of the list elements.
<!-- .Hw -->
<!-- .Ib -->
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>internalHeight</function>
    </term>
    <listitem>
      <para>
<!-- .br -->
<!-- .ns -->
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>internalWidth</function>
    </term>
    <listitem>
      <para>
The margin, in pixels, between the edges of the list and the
corresponding edge of the List widget's window.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>list</function>
    </term>
    <listitem>
      <para>
An array of text strings displayed in the List widget.  If
<function>numberStrings</function> is zero (the default) then the <function>list</function> must be
NULL terminated.  If a value is not specified for the <function>list</function>, then
<function>numberStrings</function> is set to 1, and the name of the widget is used as
the <function>list</function>, and <function>longest</function> is set to the length of the name of the
widget.  The <function>list</function> is used in place, and must be available
to the List widget for the lifetime of this widget, or until it is
changed with <xref linkend='XtSetValues' xrefstyle='select: title'/> or <xref linkend='XawListChange' xrefstyle='select: title'/>.
<!-- .In -->
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>longest</function>
    </term>
    <listitem>
      <para>
Specifies the width, in pixels, of the longest string in the current
list.  The List widget will compute this value if zero (the default)
is specified.  If this resource is set by hand, entries longer than this
will be clipped to fit.
<!-- .Mm -->
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>numberStrings</function>
    </term>
    <listitem>
      <para>
The number of strings in the current list.  If a value of zero (the
default) is specified, the List widget will compute it.  When computing
the number of strings the List widget assumes that the <function>list</function> is NULL
terminated.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>pasteBuffer</function>
    </term>
    <listitem>
      <para>
If this resource is set to <function>True</function> then the name of the currently
selected list element will be put into <function>CUT_BUFFER_0</function>.
<!-- .Pf -->
<!-- .Pb -->
<!-- .Sc -->
<!-- .Se -->
<!-- .Tr -->
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>verticalList</function>
    </term>
    <listitem>
      <para>
If this resource is set to <function>True</function> then the list elements will be
presented in column major order.
<!-- .Xy -->
    </para>
  </listitem>
  </varlistentry>
</variablelist>
</para>
</sect2>
<sect2 id="List_Actions">
<title>List Actions</title>
<indexterm><primary>List widget</primary><secondary>actions</secondary></indexterm>
<para>
<!-- .LP -->
The List widget supports the following actions:
</para>
<itemizedlist>
  <listitem>
    <para>
Highlighting and unhighlighting the list element under the
pointer with <function>Set</function> and <function>Unset</function>
    </para>
  </listitem>
  <listitem>
    <para>
Processing application callbacks with <function>Notify</function>
    </para>
  </listitem>
</itemizedlist>
<para>
<!-- .LP -->
The following is the default translation table used by the List Widget:
<indexterm><primary>List widget</primary><secondary>default translation table</secondary></indexterm>
</para>
<para>
<!-- .LP -->
<literallayout class="monospaced">
<!-- .TA .5i 2.25i -->
<!-- .ta .5i 2.25i -->
&lt;Btn1Down&gt;,&lt;Btn1Up&gt;:	Set(&#x2006;) Notify(&#x2006;)
<!-- .sp -->
</literallayout>
</para>
<para>
<!-- .LP -->
The full list of actions supported by List widget is:
<variablelist>
  <varlistentry>
    <term>
      <function>Set</function>(&#x2006;)
    </term>
    <listitem>
      <para>
<emphasis remap='I'>Sets</emphasis> the list element that is currently under the pointer.  To
inform the user that this element is currently set, it is drawn with
foreground and background colors reversed.  If this action is called when
there is no list element under the cursor, the currently <emphasis remap='I'>set</emphasis>
element will be <emphasis remap='I'>unset</emphasis>.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>Unset</function>(&#x2006;)
    </term>
    <listitem>
      <para>
Cancels the <emphasis remap='I'>set</emphasis> state of the element under the pointer,
and redraws it with normal foreground and background colors.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <function>Notify</function>(&#x2006;)
    </term>
    <listitem>
      <para>
Calls all callbacks on the List widget's callback list.  Information
about the currently selected list element is passed in the
<emphasis remap='I'>call_data</emphasis> argument (see <function>List Callbacks</function> below).
    </para>
  </listitem>
  </varlistentry>
</variablelist>
</para>
</sect2>
<sect2 id="List_Callbacks">
<title>List Callbacks</title>
<indexterm><primary>List widget</primary><secondary>callbacks</secondary></indexterm>
<para>
<!-- .LP -->
All procedures on the List widget's callback list will have a
<function>XawListReturnStruct</function> passed to them as <emphasis remap='I'>call_data</emphasis>.  The
structure is defined in the List widget's application header file.
</para>
<!-- .LP -->
<literallayout class="monospaced">
<!-- .TA .5i 2.25i -->
<!-- .ta .5i 2.25i -->
<indexterm significance="preferred"><primary>XawListReturnStruct</primary></indexterm>
typedef struct _XawListReturnStruct {
	String string;	/* string shown in the list. */
	int list_index;	/* index of the item selected. */
} XawListReturnStruct;
<indexterm><primary>XawListReturnStruct</primary></indexterm>
<!-- .NT -->
</literallayout>
<note><para>
The <emphasis remap='I'>list_index</emphasis> item used to be called simply <emphasis remap='I'>index</emphasis>.
Unfortunately, this name collided with a global name defined on some
operating systems, and had to be changed.
</para></note>
<!-- .NE -->
</sect2>
<sect2 id="Changing_the_List">
<title>Changing the List</title>
<para>
<!-- .LP -->
To change the list that is displayed, use
<function>XawListChange</function>.
<indexterm significance="preferred"><primary>XawListChange</primary></indexterm>
<funcsynopsis id='XawListChange'>
<funcprototype>
  <funcdef>void<function> XawListChange</function></funcdef>
  <paramdef>Widget<parameter> w</parameter></paramdef>
  <paramdef>String*<parameter> list</parameter></paramdef>
  <paramdef>intnitems,<parameter> longest</parameter></paramdef>
  <paramdef>Boolean<parameter> resize</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>w</emphasis>
    </term>
    <listitem>
      <para>
Specifies the List widget.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>list</emphasis>
    </term>
    <listitem>
      <para>
Specifies the new list for the List widget to display.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>nitems</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of items in the <emphasis remap='I'>list</emphasis>.  If a value less than 1
is specified, <emphasis remap='I'>list</emphasis> must be NULL terminated, and the number of
items will be calculated by the List widget.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>longest</emphasis>
    </term>
    <listitem>
      <para>
Specifies the length of the longest item in the <emphasis remap='I'>list</emphasis> in pixels.
If a value less than 1 is specified, the List widget will calculate the
value.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>resize</emphasis>
    </term>
    <listitem>
      <para>
Specifies a Boolean value that if <function>True</function> indicates that the
List widget should try to resize itself after making the change.
The constraints of the List widget's parent are always enforced,
regardless of the value specified here.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
<xref linkend='XawListChange' xrefstyle='select: title'/>
will <emphasis remap='I'>unset</emphasis> all list elements that are currently <function>set</function> before
the list is actually changed.  The <emphasis remap='I'>list</emphasis> is used in place, and must
remain usable for the lifetime of the List widget, or until <emphasis remap='I'>list</emphasis>
has been changed again with this function or with <xref linkend='XtSetValues' xrefstyle='select: title'/>.
</para>
</sect2>
<sect2 id="Highlighting_an_Item">
<title>Highlighting an Item</title>
<para>
<!-- .LP -->
To highlight an item in the list, use
<function>XawListHighlight</function>.
<indexterm significance="preferred"><primary>XawListHighlight</primary></indexterm>
<funcsynopsis id='XawListHighlight'>
<funcprototype>
  <funcdef>void<function> XawListHighlight</function></funcdef>
  <paramdef>Widget<parameter> w</parameter></paramdef>
  <paramdef>int<parameter> item</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>w</emphasis>
    </term>
    <listitem>
      <para>
Specifies the List widget.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>item</emphasis>
    </term>
    <listitem>
      <para>
Specifies an index into the current list that indicates the item to be
highlighted.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
Only one item can be highlighted at a time.
If an item is already highlighted when
<xref linkend='XawListHighlight' xrefstyle='select: title'/>
is called,
the highlighted item is unhighlighted before the new item is highlighted.
</para>
</sect2>
<sect2 id="Unhighlighting_an_Item">
<title>Unhighlighting an Item</title>
<para>
<!-- .LP -->
To unhighlight the currently highlighted item in the list, use
<function>XawListUnhighlight</function>.
<indexterm significance="preferred"><primary>XawListUnhighlight</primary></indexterm>
<funcsynopsis id='XawListUnhighlight'>
<funcprototype>
  <funcdef>void<function> XawListUnhighlight</function></funcdef>
  <paramdef>Widget<parameter> w</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>w</emphasis>
    </term>
    <listitem>
      <para>
Specifies the List widget.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
</para>
</sect2>
<sect2 id="Retrieving_the_Currently_Selected_Item">
<title>Retrieving the Currently Selected Item</title>
<para>
<!-- .LP -->
To retrieve the list element that is currently <emphasis remap='I'>set</emphasis>, use
<function>XawListShowCurrent</function>.
<indexterm significance="preferred"><primary>XawListShowCurrent</primary></indexterm>
<funcsynopsis id='XawListShowCurrent'>
<funcprototype>
  <funcdef>XawListReturnStruct<function> *XawListShowCurrent</function></funcdef>
  <paramdef>Widget<parameter> w</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>w</emphasis>
    </term>
    <listitem>
      <para>
Specifies the List widget.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
<function>XawListShowCurrent</function>
returns a pointer to an
<function>XawListReturnStruct</function>
structure,
containing the currently highlighted item.
If the value of the index member is XAW_LIST_NONE,
<indexterm><primary>XAW_LIST_NONE</primary></indexterm>
the string member is undefined, and no item is currently selected.
</para>
</sect2>
<sect2 id="Restrictions">
<title>Restrictions</title>
<para>
<!-- .LP -->
Many programmers create a <quote>scrolled list</quote> by putting a List
widget with many entries as a child of a Viewport widget.  The
List continues to create a window as big as its contents, but
that big window is only visible where it intersects the parent
Viewport's window.  (I.e., it is <quote>clipped.</quote>)
</para>
<para>
<!-- .LP -->
While this is a useful technique, there is a serious drawback.
X does not support windows above 32,767 pixels in width or
height, but this height limit will be exceeded by a List's
window when the List has many entries (i.e., with a 12 point
font, about 3000 entries would be too many.)
</para>
<para>
<!-- .LP -->

</para>
</sect2>
</sect1>