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
|
<sect1 id="Text_Functions">
<title>Text Functions</title>
<!-- .XS -->
<!-- Text Functions -->
<!-- .XE -->
<para>
<!-- .LP -->
The following functions are provided as convenience routines for use with
the Text widget. Although many of these actions can be performed by
modifying resources, these interfaces are frequently more efficient.
</para>
<para>
<!-- .LP -->
These data structures are defined in the Text widget's public header file,
<X11/Xaw/Text.h>.
</para>
<para>
<!-- .LP -->
<!-- .IN "XawTextPosition" "" "@DEF@" -->
typedef long XawTextPosition;
<!-- .sp -->
</para>
<para>
<!-- .LP -->
Character positions in the Text widget begin at 0 and end at n, where
n is the number of characters in the Text source widget.
</para>
<para>
<!-- .LP -->
<!-- .IN "XawTextBlock" "" "@DEF@" -->
<literallayout class="monospaced">
<!-- .TA .5i 1.5i 2.25i -->
<!-- .ta .5i 1.5i 2.25i -->
typedef struct {
int <emphasis remap='I'>firstPos</emphasis>;
int <emphasis remap='I'>length</emphasis>;
char *<emphasis remap='I'>ptr</emphasis>;
unsigned long <emphasis remap='I'>format</emphasis>;
} XawTextBlock, *XawTextBlockPtr;
</literallayout>
</para>
<para>
<!-- .LP -->
<!-- .IN "XawTextBlockPtr" "" -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>firstPos</emphasis>
</term>
<listitem>
<para>
The first position, or index, to use within the <emphasis remap='I'>ptr</emphasis> field.
The value is commonly zero.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>length</emphasis>
</term>
<listitem>
<para>
The number of characters to be used from the <emphasis remap='I'>ptr</emphasis> field.
The number of characters used is commonly the number of characters
in <emphasis remap='I'>ptr</emphasis>, and must not be greater than the length of the string
in <emphasis remap='I'>ptr</emphasis>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>ptr</emphasis>
</term>
<listitem>
<para>
Contains the string to be referenced by the Text widget.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>format</emphasis>
</term>
<listitem>
<para>
This flag indicates whether the data pointed to by <function>ptr</function> is char
or wchar_t. When the associated widget has <function>international</function> set
to <function>false</function> this field must be XawFmt8Bit. When the associated
widget has <function>international</function> set to <function>true</function> this field must be
either XawFmt8Bit or XawFmtWide.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<note>
<para>
<!-- .LP -->
Note: Previous versions of Xaw used
<function>FMT8BIT ,</function>
which has been retained for backwards compatibility. <function>FMT8BIT</function> is
deprecated and will eventually be removed from the implementation.
</para>
</note>
<sect2 id="Selecting_Text">
<title>Selecting Text</title>
<para>
<!-- .LP -->
To select a piece of text, use
<function>XawTextSetSelection : </function>
<!-- .IN "XawTextSetSelection" "" "@DEF@" -->
<funcsynopsis id='XawTextSetSelection'>
<funcprototype>
<funcdef>void<function> XawTextSetSelection</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
<paramdef>XawTextPositionleft,<parameter> right</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>left</emphasis>
</term>
<listitem>
<para>
Specifies the character position at which the selection begins.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>right</emphasis>
</term>
<listitem>
<para>
Specifies the character position at which the selection ends.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
See section 5.4 for a description of <function>XawTextPosition</function>. <!-- xref -->
If redisplay is enabled, this function highlights the text and
makes it the <function>PRIMARY</function> selection. This function does not have any
effect on <function>CUT_BUFFER0</function>.
</para>
<para>
<!-- .LP -->
</para>
</sect2>
<sect2 id="Unhighlighting_Text">
<title>Unhighlighting Text</title>
<para>
<!-- .LP -->
To unhighlight previously highlighted text in a widget, use
<xref linkend='XawTextUnsetSelection' xrefstyle='select: title'/>:
<!-- .IN "XawTextUnsetSelection" "" "@DEF@" -->
<funcsynopsis id='XawTextUnsetSelection'>
<funcprototype>
<funcdef>void<function> XawTextUnsetSelection</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</sect2>
<sect2 id="Getting_Current_Text_Selection">
<title>Getting Current Text Selection</title>
<para>
<!-- .LP -->
To retrieve the text that has been selected by this
text widget use <xref linkend='XawTextGetSelectionPos' xrefstyle='select: title'/>:
<!-- .IN "XawTextGetSelectionPos" "" "@DEF@" -->
<funcsynopsis id='XawTextGetSelectionPos'>
<funcprototype>
<funcdef>void<function> XawTextGetSelectionPos</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
<paramdef>XawTextPosition*begin_return,<parameter> *end_return</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>begin_return</emphasis>
</term>
<listitem>
<para>
Returns the beginning of the text selection.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>end_return</emphasis>
</term>
<listitem>
<para>
Returns the end of the text selection.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
See section 5.4 for a description of <function>XawTextPosition</function>. <!-- xref -->
If the returned values are equal, no text is currently selected.
</para>
</sect2>
<sect2 id="Replacing_Text">
<title>Replacing Text</title>
<para>
<!-- .LP -->
To modify the text in an editable Text widget use <xref linkend='XawTextReplace' xrefstyle='select: title'/>:
<!-- .IN "XawTextReplace" "" "@DEF@" -->
<funcsynopsis id='XawTextReplace'>
<funcprototype>
<funcdef>int<function> XawTextReplace</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
<paramdef>XawTextPositionstart,<parameter> end</parameter></paramdef>
<paramdef>XawTextBlock<parameter> *text</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>start</emphasis>
</term>
<listitem>
<para>
Specifies the starting character position of the text replacement.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>end</emphasis>
</term>
<listitem>
<para>
Specifies the ending character position of the text replacement.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>text</emphasis>
</term>
<listitem>
<para>
Specifies the text to be inserted into the file.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
This function will not
be able to replace text in read-only text widgets. It will also only
be able to append text to an append-only text widget.
</para>
<para>
<!-- .LP -->
See section 5.4 for a description of <function>XawTextPosition</function> and <!-- xref -->
<function>XawTextBlock</function>.
</para>
<para>
<!-- .LP -->
This function may return the following values:
<variablelist>
<varlistentry>
<term>
<function>XawEditDone</function>
</term>
<listitem>
<para>
<!-- .IN "XawEditDone" "" -->
The text replacement was successful.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<function>XawPositionError</function>
</term>
<listitem>
<para>
<!-- .IN "XawPositionError" "" -->
The edit mode is <function>XawtextAppend</function> and <function>start</function> is not the position of
the last character of the source.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<function>XawEditError</function>
</term>
<listitem>
<para>
<!-- .IN "XawEditError" "" -->
Either the Source was read-only or the range to be deleted is larger
than the length of the Source.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
The <xref linkend='XawTextReplace' xrefstyle='select: title'/> arguments <function>start</function> and
<emphasis remap='I'>end</emphasis> represent the text source character positions for the
existing text that is to be replaced by the text in the text block.
The characters from <emphasis remap='I'>start</emphasis> up to
but not including <emphasis remap='I'>end</emphasis> are deleted, and the characters
specified on the text block are inserted in their place. If
<emphasis remap='I'>start</emphasis> and <emphasis remap='I'>end</emphasis> are equal, no text is deleted and the new
text is inserted after <emphasis remap='I'>start</emphasis>.
</para>
</sect2>
<sect2 id="Searching_for_Text">
<title>Searching for Text</title>
<para>
<!-- .LP -->
To search for a string in the Text widget, use
<xref linkend='XawTextSearch' xrefstyle='select: title'/>:
<!-- .IN "XawTextSearch" "" "@DEF@" -->
<funcsynopsis id='XawTextSearch'>
<funcprototype>
<funcdef>XawTextPosition<function> XawTextSearch</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
<paramdef>XawTextScanDirection<parameter> dir</parameter></paramdef>
<paramdef>XawTextBlock*<parameter> text</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>dir</emphasis>
</term>
<listitem>
<para>
Specifies the direction to search in. Legal values are
<function>XawsdLeft</function> and <function>XawsdRight</function>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>text</emphasis>
</term>
<listitem>
<para>
Specifies a text block structure that contains the text to search for.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
See section 5.4 for a description of <function>XawTextPosition</function> and <function>XawTextBlock</function>. <!-- xref -->
The <xref linkend='XawTextSearch' xrefstyle='select: title'/> function will begin at the insertion point
and search in the
direction specified for a string that matches the one passed in
<emphasis remap='I'>text</emphasis>. If the string is found the location of the first
character in the string is returned. If the string could not be
found then the value <function>XawTextSearchError</function> is returned.
</para>
</sect2>
<sect2 id="Redisplaying_Text">
<title>Redisplaying Text</title>
<para>
<!-- .LP -->
To redisplay a range of characters, use <xref linkend='XawTextInvalidate' xrefstyle='select: title'/>:
<!-- .IN "XawTextInvalidate" "" "@DEF@" -->
<funcsynopsis id='XawTextInvalidate'>
<funcprototype>
<funcdef>void<function> XawTextInvalidate</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
<paramdef>XawTextPositionfrom,<parameter> to</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>from</emphasis>
</term>
<listitem>
<para>
Specifies the start of the text to redisplay.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>to</emphasis>
</term>
<listitem>
<para>
Specifies the end of the text to redisplay.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
See section 5.4 for a description of <function>XawTextPosition</function>. <!-- xref -->
The <xref linkend='XawTextInvalidate' xrefstyle='select: title'/>
function causes the specified range of characters to be redisplayed
immediately if redisplay is enabled or the next time that redisplay is
enabled.
</para>
<para>
<!-- .LP -->
<!-- .sp 1 -->
To enable redisplay, use <xref linkend='XawTextEnableRedisplay' xrefstyle='select: title'/>:
<!-- .IN "XawTextEnableRedisplay" "" "@DEF@" -->
<funcsynopsis id='XawTextEnableRedisplay'>
<funcprototype>
<funcdef>void<function> XawTextEnableRedisplay</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
The <xref linkend='XawTextEnableRedisplay' xrefstyle='select: title'/> function flushes any changes due to
batched updates when <xref linkend='XawTextDisableRedisplay' xrefstyle='select: title'/>
was called and allows future changes to be reflected immediately.
</para>
<para>
<!-- .LP -->
<!-- .sp 1 -->
To disable redisplay while making several changes, use
<xref linkend='XawTextDisableRedisplay' xrefstyle='select: title'/>.
<!-- .IN "XawTextDisableRedisplay" "" "@DEF@" -->
<funcsynopsis id='XawTextDisableRedisplay'>
<funcprototype>
<funcdef>void<function> XawTextDisableRedisplay</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
The <xref linkend='XawTextDisableRedisplay' xrefstyle='select: title'/> function causes all changes to be
batched until either <xref linkend='XawTextDisplay' xrefstyle='select: title'/> or <xref linkend='XawTextEnableRedisplay' xrefstyle='select: title'/>
is called.
</para>
<para>
<!-- .LP -->
<!-- .sp 1 -->
To display batched updates, use <xref linkend='XawTextDisplay' xrefstyle='select: title'/>:
<!-- .IN "XawTextDisplay" "" "@DEF@" -->
<funcsynopsis id='XawTextDisplay'>
<funcprototype>
<funcdef>void<function> XawTextDisplay</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
The <xref linkend='XawTextDisplay' xrefstyle='select: title'/> function forces any accumulated updates to be
displayed.
</para>
</sect2>
<sect2 id="Resources_Convenience_Routines">
<title>Resources Convenience Routines</title>
<para>
<!-- .LP -->
To obtain the character position of the left-most character on the
first line displayed in the widget (the value of the
<function>displayPosition</function> resource), use <xref linkend='XawTextTopPosition' xrefstyle='select: title'/>.
<!-- .IN "XawTextTopPosition" "" @DEF@" -->
<funcsynopsis id='XawTextTopPosition'>
<funcprototype>
<funcdef>XawTextPosition<function> XawTextTopPosition</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
<!-- .sp 1 -->
To assign a new selection array to a text widget use
<xref linkend='XawTextSetSelectionArray' xrefstyle='select: title'/>:
<!-- .IN "XawTextSetSelectionArray" "" "@DEF@" -->
<funcsynopsis id='XawTextSetSelectionArray'>
<funcprototype>
<funcdef>void<function> XawTextSetSelectionArray</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
<paramdef>XawTextSelectType*<parameter> sarray</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>sarray</emphasis>
</term>
<listitem>
<para>
Specifies a selection array as defined in the section called \fBText
Selections for Application Programmers\fP.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
Calling this function is equivalent to setting the value of the
<function>selectionTypes</function> resource.
</para>
<para>
<!-- .LP -->
<!-- .sp 1 -->
To move the insertion point to the specified source position, use
<xref linkend='XawTextSetInsertionPoint' xrefstyle='select: title'/>:
<!-- .IN "XawTextSetInsertionPoint" "" "@DEF@" -->
<funcsynopsis id='XawTextSetInsertionPoint'>
<funcprototype>
<funcdef>void<function> XawTextSetInsertionPoint</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
<paramdef>XawTextPosition<parameter> position</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>position</emphasis>
</term>
<listitem>
<para>
Specifies the new position for the insertion point.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
See section 5.4 for a description of <function>XawTextPosition</function>. <!-- xref -->
The text will be scrolled vertically if necessary to make the line
containing the insertion point visible. Calling this function is
equivalent to setting the <function>insertPosition</function> resource.
</para>
<para>
<!-- .LP -->
<!-- .sp 1 -->
To obtain the current position of the insertion point, use
<xref linkend='XawTextGetInsertionPoint' xrefstyle='select: title'/>:
<!-- .IN "XawTextGetInsertionPoint" "" "@DEF@" -->
<funcsynopsis id='XawTextGetInsertionPoint'>
<funcprototype>
<funcdef>XawTextPosition<function> XawTextGetInsertionPoint</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
See section 5.4 for a description of <function>XawTextPosition</function>. <!-- xref -->
The result is equivalent to retrieving the value of the
<function>insertPosition</function> resource.
</para>
<para>
<!-- .LP -->
<!-- .sp 1 -->
To replace the text source in the specified widget, use
<xref linkend='XawTextSetSource' xrefstyle='select: title'/>:
<!-- .IN "XawTextSetSource" "" "@DEF@" -->
<funcsynopsis id='XawTextSetSource'>
<funcprototype>
<funcdef>void<function> XawTextSetSource</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
<paramdef>Widget<parameter> source</parameter></paramdef>
<paramdef>XawTextPosition<parameter> position</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>source</emphasis>
</term>
<listitem>
<para>
Specifies the text source object.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>position</emphasis>
</term>
<listitem>
<para>
Specifies character position that will become the upper left hand corner
of the displayed text. This is usually set to zero.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
See section 5.4 for a description of <function>XawTextPosition</function>. <!-- xref -->
A display update will be performed if redisplay is enabled.
</para>
<para>
<!-- .LP -->
<!-- .sp 1 -->
To obtain the current text source for the specified widget, use
<xref linkend='XawTextGetSource' xrefstyle='select: title'/>:
<!-- .IN "XawTextGetSource" "" "@DEF@" -->
<funcsynopsis id='XawTextGetSource'>
<funcprototype>
<funcdef>Widget<function> XawTextGetSource</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
This function returns the text source that this Text widget is currently
using.
</para>
<para>
<!-- .LP -->
<!-- .sp -->
To enable and disable the insertion point, use
<xref linkend='XawTextDisplayCaret' xrefstyle='select: title'/>:
<!-- .IN "XawTextDisplayCaret" "" "@DEF@" -->
<funcsynopsis id='XawTextDisplayCaret'>
<funcprototype>
<funcdef>void<function> XawTextDisplayCaret</function></funcdef>
<paramdef>Widget<parameter> w</parameter></paramdef>
<paramdef>Boolean<parameter> visible</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
<varlistentry>
<term>
<emphasis remap='I'>w</emphasis>
</term>
<listitem>
<para>
Specifies the Text widget.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis remap='I'>visible</emphasis>
</term>
<listitem>
<para>
Specifies whether or not the caret should be displayed.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<!-- .LP -->
If <function>visible</function> is <function>False</function> the insertion point will be disabled.
The marker is re-enabled either by setting <function>visible</function> to <function>True</function>, by
calling <xref linkend='XtSetValues' xrefstyle='select: title'/>, or by executing the <function>display-caret</function>
action routine.
</para>
</sect2>
</sect1>
|