1994689c1Smrg<sect1 id="Text_Functions"> 2994689c1Smrg<title>Text Functions</title> 3994689c1Smrg<!-- .XS --> 4994689c1Smrg<!-- Text Functions --> 5994689c1Smrg<!-- .XE --> 6994689c1Smrg<para> 7994689c1Smrg<!-- .LP --> 8994689c1SmrgThe following functions are provided as convenience routines for use with 9994689c1Smrgthe Text widget. Although many of these actions can be performed by 10994689c1Smrgmodifying resources, these interfaces are frequently more efficient. 11994689c1Smrg</para> 12994689c1Smrg<para> 13994689c1Smrg<!-- .LP --> 14994689c1SmrgThese data structures are defined in the Text widget's public header file, 15994689c1Smrg<X11/Xaw/Text.h>. 16994689c1Smrg</para> 17994689c1Smrg<para> 18994689c1Smrg<!-- .LP --> 195ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextPosition</primary></indexterm> 20994689c1Smrgtypedef long XawTextPosition; 21994689c1Smrg<!-- .sp --> 22994689c1Smrg</para> 23994689c1Smrg<para> 24994689c1Smrg<!-- .LP --> 25994689c1SmrgCharacter positions in the Text widget begin at 0 and end at n, where 26994689c1Smrgn is the number of characters in the Text source widget. 27994689c1Smrg</para> 28994689c1Smrg<para> 29994689c1Smrg<!-- .LP --> 305ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextBlock</primary></indexterm> 31994689c1Smrg<literallayout class="monospaced"> 32994689c1Smrg<!-- .TA .5i 1.5i 2.25i --> 33994689c1Smrg<!-- .ta .5i 1.5i 2.25i --> 34994689c1Smrgtypedef struct { 35994689c1Smrg int <emphasis remap='I'>firstPos</emphasis>; 36994689c1Smrg int <emphasis remap='I'>length</emphasis>; 37994689c1Smrg char *<emphasis remap='I'>ptr</emphasis>; 38994689c1Smrg unsigned long <emphasis remap='I'>format</emphasis>; 39994689c1Smrg} XawTextBlock, *XawTextBlockPtr; 40994689c1Smrg</literallayout> 41994689c1Smrg</para> 42994689c1Smrg<para> 43994689c1Smrg<!-- .LP --> 445ec34c4cSmrg<indexterm><primary>XawTextBlockPtr</primary></indexterm> 45994689c1Smrg<variablelist> 46994689c1Smrg <varlistentry> 47994689c1Smrg <term> 48994689c1Smrg <emphasis remap='I'>firstPos</emphasis> 49994689c1Smrg </term> 50994689c1Smrg <listitem> 51994689c1Smrg <para> 52994689c1SmrgThe first position, or index, to use within the <emphasis remap='I'>ptr</emphasis> field. 53994689c1SmrgThe value is commonly zero. 54994689c1Smrg </para> 55994689c1Smrg </listitem> 56994689c1Smrg </varlistentry> 57994689c1Smrg <varlistentry> 58994689c1Smrg <term> 59994689c1Smrg <emphasis remap='I'>length</emphasis> 60994689c1Smrg </term> 61994689c1Smrg <listitem> 62994689c1Smrg <para> 63994689c1SmrgThe number of characters to be used from the <emphasis remap='I'>ptr</emphasis> field. 64994689c1SmrgThe number of characters used is commonly the number of characters 65994689c1Smrgin <emphasis remap='I'>ptr</emphasis>, and must not be greater than the length of the string 66994689c1Smrgin <emphasis remap='I'>ptr</emphasis>. 67994689c1Smrg </para> 68994689c1Smrg </listitem> 69994689c1Smrg </varlistentry> 70994689c1Smrg <varlistentry> 71994689c1Smrg <term> 72994689c1Smrg <emphasis remap='I'>ptr</emphasis> 73994689c1Smrg </term> 74994689c1Smrg <listitem> 75994689c1Smrg <para> 76994689c1SmrgContains the string to be referenced by the Text widget. 77994689c1Smrg </para> 78994689c1Smrg </listitem> 79994689c1Smrg </varlistentry> 80994689c1Smrg <varlistentry> 81994689c1Smrg <term> 82994689c1Smrg <emphasis remap='I'>format</emphasis> 83994689c1Smrg </term> 84994689c1Smrg <listitem> 85994689c1Smrg <para> 86994689c1SmrgThis flag indicates whether the data pointed to by <function>ptr</function> is char 87994689c1Smrgor wchar_t. When the associated widget has <function>international</function> set 88994689c1Smrgto <function>false</function> this field must be XawFmt8Bit. When the associated 89994689c1Smrgwidget has <function>international</function> set to <function>true</function> this field must be 90994689c1Smrgeither XawFmt8Bit or XawFmtWide. 91994689c1Smrg </para> 92994689c1Smrg </listitem> 93994689c1Smrg </varlistentry> 94994689c1Smrg</variablelist> 95994689c1Smrg</para> 96994689c1Smrg<note> 97994689c1Smrg<para> 98994689c1Smrg<!-- .LP --> 99994689c1SmrgNote: Previous versions of Xaw used 1005ec34c4cSmrg<function>FMT8BIT</function>, 101994689c1Smrgwhich has been retained for backwards compatibility. <function>FMT8BIT</function> is 102994689c1Smrgdeprecated and will eventually be removed from the implementation. 103994689c1Smrg</para> 104994689c1Smrg</note> 105994689c1Smrg<sect2 id="Selecting_Text"> 106994689c1Smrg<title>Selecting Text</title> 107994689c1Smrg<para> 108994689c1Smrg<!-- .LP --> 109994689c1SmrgTo select a piece of text, use 110994689c1Smrg<function>XawTextSetSelection : </function> 1115ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextSetSelection</primary></indexterm> 112421c997bSmrg<funcsynopsis id='XawTextSetSelection'> 113994689c1Smrg<funcprototype> 114994689c1Smrg <funcdef>void<function> XawTextSetSelection</function></funcdef> 115994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 116994689c1Smrg <paramdef>XawTextPositionleft,<parameter> right</parameter></paramdef> 117994689c1Smrg</funcprototype> 118994689c1Smrg</funcsynopsis> 119994689c1Smrg<!-- .FN --> 120994689c1Smrg<variablelist> 121994689c1Smrg <varlistentry> 122994689c1Smrg <term> 123994689c1Smrg <emphasis remap='I'>w</emphasis> 124994689c1Smrg </term> 125994689c1Smrg <listitem> 126994689c1Smrg <para> 127994689c1SmrgSpecifies the Text widget. 128994689c1Smrg </para> 129994689c1Smrg </listitem> 130994689c1Smrg </varlistentry> 131994689c1Smrg <varlistentry> 132994689c1Smrg <term> 133994689c1Smrg <emphasis remap='I'>left</emphasis> 134994689c1Smrg </term> 135994689c1Smrg <listitem> 136994689c1Smrg <para> 137994689c1SmrgSpecifies the character position at which the selection begins. 138994689c1Smrg </para> 139994689c1Smrg </listitem> 140994689c1Smrg </varlistentry> 141994689c1Smrg <varlistentry> 142994689c1Smrg <term> 143994689c1Smrg <emphasis remap='I'>right</emphasis> 144994689c1Smrg </term> 145994689c1Smrg <listitem> 146994689c1Smrg <para> 147994689c1SmrgSpecifies the character position at which the selection ends. 148994689c1Smrg </para> 149994689c1Smrg </listitem> 150994689c1Smrg </varlistentry> 151994689c1Smrg</variablelist> 152994689c1Smrg</para> 153994689c1Smrg<para> 154994689c1Smrg<!-- .LP --> 1555ec34c4cSmrg<link linkend="Text_Functions">See section 5.4</link> 1565ec34c4cSmrgfor a description of <function>XawTextPosition</function>. 157994689c1SmrgIf redisplay is enabled, this function highlights the text and 158994689c1Smrgmakes it the <function>PRIMARY</function> selection. This function does not have any 159994689c1Smrgeffect on <function>CUT_BUFFER0</function>. 160994689c1Smrg</para> 161994689c1Smrg<para> 162994689c1Smrg<!-- .LP --> 163994689c1Smrg</para> 164994689c1Smrg</sect2> 165994689c1Smrg<sect2 id="Unhighlighting_Text"> 166994689c1Smrg<title>Unhighlighting Text</title> 167994689c1Smrg<para> 168994689c1Smrg<!-- .LP --> 169994689c1SmrgTo unhighlight previously highlighted text in a widget, use 170421c997bSmrg<xref linkend='XawTextUnsetSelection' xrefstyle='select: title'/>: 1715ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextUnsetSelection</primary></indexterm> 172421c997bSmrg<funcsynopsis id='XawTextUnsetSelection'> 173994689c1Smrg<funcprototype> 174994689c1Smrg <funcdef>void<function> XawTextUnsetSelection</function></funcdef> 175994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 176994689c1Smrg</funcprototype> 177994689c1Smrg</funcsynopsis> 178994689c1Smrg<!-- .FN --> 179994689c1Smrg<variablelist> 180994689c1Smrg <varlistentry> 181994689c1Smrg <term> 182994689c1Smrg <emphasis remap='I'>w</emphasis> 183994689c1Smrg </term> 184994689c1Smrg <listitem> 185994689c1Smrg <para> 186994689c1SmrgSpecifies the Text widget. 187994689c1Smrg </para> 188994689c1Smrg </listitem> 189994689c1Smrg </varlistentry> 190994689c1Smrg</variablelist> 191994689c1Smrg</para> 192994689c1Smrg</sect2> 193994689c1Smrg<sect2 id="Getting_Current_Text_Selection"> 194994689c1Smrg<title>Getting Current Text Selection</title> 195994689c1Smrg<para> 196994689c1Smrg<!-- .LP --> 197994689c1SmrgTo retrieve the text that has been selected by this 198421c997bSmrgtext widget use <xref linkend='XawTextGetSelectionPos' xrefstyle='select: title'/>: 1995ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextGetSelectionPos</primary></indexterm> 200421c997bSmrg<funcsynopsis id='XawTextGetSelectionPos'> 201994689c1Smrg<funcprototype> 202994689c1Smrg <funcdef>void<function> XawTextGetSelectionPos</function></funcdef> 203994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 204994689c1Smrg <paramdef>XawTextPosition*begin_return,<parameter> *end_return</parameter></paramdef> 205994689c1Smrg</funcprototype> 206994689c1Smrg</funcsynopsis> 207994689c1Smrg<!-- .FN --> 208994689c1Smrg<variablelist> 209994689c1Smrg <varlistentry> 210994689c1Smrg <term> 211994689c1Smrg <emphasis remap='I'>w</emphasis> 212994689c1Smrg </term> 213994689c1Smrg <listitem> 214994689c1Smrg <para> 215994689c1SmrgSpecifies the Text widget. 216994689c1Smrg </para> 217994689c1Smrg </listitem> 218994689c1Smrg </varlistentry> 219994689c1Smrg <varlistentry> 220994689c1Smrg <term> 221994689c1Smrg <emphasis remap='I'>begin_return</emphasis> 222994689c1Smrg </term> 223994689c1Smrg <listitem> 224994689c1Smrg <para> 225994689c1SmrgReturns the beginning of the text selection. 226994689c1Smrg </para> 227994689c1Smrg </listitem> 228994689c1Smrg </varlistentry> 229994689c1Smrg <varlistentry> 230994689c1Smrg <term> 231994689c1Smrg <emphasis remap='I'>end_return</emphasis> 232994689c1Smrg </term> 233994689c1Smrg <listitem> 234994689c1Smrg <para> 235994689c1SmrgReturns the end of the text selection. 236994689c1Smrg </para> 237994689c1Smrg </listitem> 238994689c1Smrg </varlistentry> 239994689c1Smrg</variablelist> 240994689c1Smrg</para> 241994689c1Smrg<para> 242994689c1Smrg<!-- .LP --> 2435ec34c4cSmrg<link linkend="Text_Functions">See section 5.4</link> 2445ec34c4cSmrgfor a description of <function>XawTextPosition</function>. 245994689c1SmrgIf the returned values are equal, no text is currently selected. 246994689c1Smrg</para> 247994689c1Smrg</sect2> 248994689c1Smrg<sect2 id="Replacing_Text"> 249994689c1Smrg<title>Replacing Text</title> 250994689c1Smrg<para> 251994689c1Smrg<!-- .LP --> 252421c997bSmrgTo modify the text in an editable Text widget use <xref linkend='XawTextReplace' xrefstyle='select: title'/>: 2535ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextReplace</primary></indexterm> 254421c997bSmrg<funcsynopsis id='XawTextReplace'> 255994689c1Smrg<funcprototype> 256994689c1Smrg <funcdef>int<function> XawTextReplace</function></funcdef> 257994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 258994689c1Smrg <paramdef>XawTextPositionstart,<parameter> end</parameter></paramdef> 259994689c1Smrg <paramdef>XawTextBlock<parameter> *text</parameter></paramdef> 260994689c1Smrg</funcprototype> 261994689c1Smrg</funcsynopsis> 262994689c1Smrg<!-- .FN --> 263994689c1Smrg<variablelist> 264994689c1Smrg <varlistentry> 265994689c1Smrg <term> 266994689c1Smrg <emphasis remap='I'>w</emphasis> 267994689c1Smrg </term> 268994689c1Smrg <listitem> 269994689c1Smrg <para> 270994689c1SmrgSpecifies the Text widget. 271994689c1Smrg </para> 272994689c1Smrg </listitem> 273994689c1Smrg </varlistentry> 274994689c1Smrg <varlistentry> 275994689c1Smrg <term> 276994689c1Smrg <emphasis remap='I'>start</emphasis> 277994689c1Smrg </term> 278994689c1Smrg <listitem> 279994689c1Smrg <para> 280994689c1SmrgSpecifies the starting character position of the text replacement. 281994689c1Smrg </para> 282994689c1Smrg </listitem> 283994689c1Smrg </varlistentry> 284994689c1Smrg <varlistentry> 285994689c1Smrg <term> 286994689c1Smrg <emphasis remap='I'>end</emphasis> 287994689c1Smrg </term> 288994689c1Smrg <listitem> 289994689c1Smrg <para> 290994689c1SmrgSpecifies the ending character position of the text replacement. 291994689c1Smrg </para> 292994689c1Smrg </listitem> 293994689c1Smrg </varlistentry> 294994689c1Smrg <varlistentry> 295994689c1Smrg <term> 296994689c1Smrg <emphasis remap='I'>text</emphasis> 297994689c1Smrg </term> 298994689c1Smrg <listitem> 299994689c1Smrg <para> 300994689c1SmrgSpecifies the text to be inserted into the file. 301994689c1Smrg </para> 302994689c1Smrg </listitem> 303994689c1Smrg </varlistentry> 304994689c1Smrg</variablelist> 305994689c1Smrg</para> 306994689c1Smrg<para> 307994689c1Smrg<!-- .LP --> 308994689c1SmrgThis function will not 309994689c1Smrgbe able to replace text in read-only text widgets. It will also only 310994689c1Smrgbe able to append text to an append-only text widget. 311994689c1Smrg</para> 312994689c1Smrg<para> 313994689c1Smrg<!-- .LP --> 3145ec34c4cSmrg<link linkend="Text_Functions">See section 5.4</link> 3155ec34c4cSmrgfor a description of <function>XawTextPosition</function> and 316994689c1Smrg<function>XawTextBlock</function>. 317994689c1Smrg</para> 318994689c1Smrg<para> 319994689c1Smrg<!-- .LP --> 320994689c1SmrgThis function may return the following values: 321994689c1Smrg<variablelist> 322994689c1Smrg <varlistentry> 323994689c1Smrg <term> 324994689c1Smrg <function>XawEditDone</function> 325994689c1Smrg </term> 326994689c1Smrg <listitem> 327994689c1Smrg <para> 3285ec34c4cSmrg<indexterm><primary>XawEditDone</primary></indexterm> 329994689c1SmrgThe text replacement was successful. 330994689c1Smrg </para> 331994689c1Smrg </listitem> 332994689c1Smrg </varlistentry> 333994689c1Smrg <varlistentry> 334994689c1Smrg <term> 335994689c1Smrg <function>XawPositionError</function> 336994689c1Smrg </term> 337994689c1Smrg <listitem> 338994689c1Smrg <para> 3395ec34c4cSmrg<indexterm><primary>XawPositionError</primary></indexterm> 340994689c1SmrgThe edit mode is <function>XawtextAppend</function> and <function>start</function> is not the position of 341994689c1Smrgthe last character of the source. 342994689c1Smrg </para> 343994689c1Smrg </listitem> 344994689c1Smrg </varlistentry> 345994689c1Smrg <varlistentry> 346994689c1Smrg <term> 347994689c1Smrg <function>XawEditError</function> 348994689c1Smrg </term> 349994689c1Smrg <listitem> 350994689c1Smrg <para> 3515ec34c4cSmrg<indexterm><primary>XawEditError</primary></indexterm> 352994689c1SmrgEither the Source was read-only or the range to be deleted is larger 353994689c1Smrgthan the length of the Source. 354994689c1Smrg 355994689c1Smrg </para> 356994689c1Smrg </listitem> 357994689c1Smrg </varlistentry> 358994689c1Smrg</variablelist> 359994689c1Smrg</para> 360994689c1Smrg<para> 361994689c1Smrg<!-- .LP --> 362421c997bSmrgThe <xref linkend='XawTextReplace' xrefstyle='select: title'/> arguments <function>start</function> and 363994689c1Smrg<emphasis remap='I'>end</emphasis> represent the text source character positions for the 364994689c1Smrgexisting text that is to be replaced by the text in the text block. 365994689c1SmrgThe characters from <emphasis remap='I'>start</emphasis> up to 366994689c1Smrgbut not including <emphasis remap='I'>end</emphasis> are deleted, and the characters 367994689c1Smrgspecified on the text block are inserted in their place. If 368994689c1Smrg<emphasis remap='I'>start</emphasis> and <emphasis remap='I'>end</emphasis> are equal, no text is deleted and the new 369994689c1Smrgtext is inserted after <emphasis remap='I'>start</emphasis>. 370994689c1Smrg</para> 371994689c1Smrg</sect2> 372994689c1Smrg<sect2 id="Searching_for_Text"> 373994689c1Smrg<title>Searching for Text</title> 374994689c1Smrg<para> 375994689c1Smrg<!-- .LP --> 376994689c1SmrgTo search for a string in the Text widget, use 377421c997bSmrg<xref linkend='XawTextSearch' xrefstyle='select: title'/>: 3785ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextSearch</primary></indexterm> 379421c997bSmrg<funcsynopsis id='XawTextSearch'> 380994689c1Smrg<funcprototype> 381994689c1Smrg <funcdef>XawTextPosition<function> XawTextSearch</function></funcdef> 382994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 383994689c1Smrg <paramdef>XawTextScanDirection<parameter> dir</parameter></paramdef> 384994689c1Smrg <paramdef>XawTextBlock*<parameter> text</parameter></paramdef> 385994689c1Smrg</funcprototype> 386994689c1Smrg</funcsynopsis> 387994689c1Smrg<!-- .FN --> 388994689c1Smrg<variablelist> 389994689c1Smrg <varlistentry> 390994689c1Smrg <term> 391994689c1Smrg <emphasis remap='I'>w</emphasis> 392994689c1Smrg </term> 393994689c1Smrg <listitem> 394994689c1Smrg <para> 395994689c1SmrgSpecifies the Text widget. 396994689c1Smrg </para> 397994689c1Smrg </listitem> 398994689c1Smrg </varlistentry> 399994689c1Smrg <varlistentry> 400994689c1Smrg <term> 401994689c1Smrg <emphasis remap='I'>dir</emphasis> 402994689c1Smrg </term> 403994689c1Smrg <listitem> 404994689c1Smrg <para> 405994689c1SmrgSpecifies the direction to search in. Legal values are 406994689c1Smrg<function>XawsdLeft</function> and <function>XawsdRight</function>. 407994689c1Smrg </para> 408994689c1Smrg </listitem> 409994689c1Smrg </varlistentry> 410994689c1Smrg <varlistentry> 411994689c1Smrg <term> 412994689c1Smrg <emphasis remap='I'>text</emphasis> 413994689c1Smrg </term> 414994689c1Smrg <listitem> 415994689c1Smrg <para> 416994689c1SmrgSpecifies a text block structure that contains the text to search for. 417994689c1Smrg </para> 418994689c1Smrg </listitem> 419994689c1Smrg </varlistentry> 420994689c1Smrg</variablelist> 421994689c1Smrg</para> 422994689c1Smrg<para> 423994689c1Smrg<!-- .LP --> 4245ec34c4cSmrg<link linkend="Text_Functions">See section 5.4</link> for a description of 4255ec34c4cSmrg<function>XawTextPosition</function> and <function>XawTextBlock</function>. 426421c997bSmrgThe <xref linkend='XawTextSearch' xrefstyle='select: title'/> function will begin at the insertion point 427994689c1Smrgand search in the 428994689c1Smrgdirection specified for a string that matches the one passed in 429994689c1Smrg<emphasis remap='I'>text</emphasis>. If the string is found the location of the first 430994689c1Smrgcharacter in the string is returned. If the string could not be 431994689c1Smrgfound then the value <function>XawTextSearchError</function> is returned. 432994689c1Smrg</para> 433994689c1Smrg</sect2> 434994689c1Smrg<sect2 id="Redisplaying_Text"> 435994689c1Smrg<title>Redisplaying Text</title> 436994689c1Smrg<para> 437994689c1Smrg<!-- .LP --> 438421c997bSmrgTo redisplay a range of characters, use <xref linkend='XawTextInvalidate' xrefstyle='select: title'/>: 4395ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextInvalidate</primary></indexterm> 440421c997bSmrg<funcsynopsis id='XawTextInvalidate'> 441994689c1Smrg<funcprototype> 442994689c1Smrg <funcdef>void<function> XawTextInvalidate</function></funcdef> 443994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 444994689c1Smrg <paramdef>XawTextPositionfrom,<parameter> to</parameter></paramdef> 445994689c1Smrg</funcprototype> 446994689c1Smrg</funcsynopsis> 447994689c1Smrg<!-- .FN --> 448994689c1Smrg<variablelist> 449994689c1Smrg <varlistentry> 450994689c1Smrg <term> 451994689c1Smrg <emphasis remap='I'>w</emphasis> 452994689c1Smrg </term> 453994689c1Smrg <listitem> 454994689c1Smrg <para> 455994689c1SmrgSpecifies the Text widget. 456994689c1Smrg </para> 457994689c1Smrg </listitem> 458994689c1Smrg </varlistentry> 459994689c1Smrg <varlistentry> 460994689c1Smrg <term> 461994689c1Smrg <emphasis remap='I'>from</emphasis> 462994689c1Smrg </term> 463994689c1Smrg <listitem> 464994689c1Smrg <para> 465994689c1SmrgSpecifies the start of the text to redisplay. 466994689c1Smrg </para> 467994689c1Smrg </listitem> 468994689c1Smrg </varlistentry> 469994689c1Smrg <varlistentry> 470994689c1Smrg <term> 471994689c1Smrg <emphasis remap='I'>to</emphasis> 472994689c1Smrg </term> 473994689c1Smrg <listitem> 474994689c1Smrg <para> 475994689c1SmrgSpecifies the end of the text to redisplay. 476994689c1Smrg </para> 477994689c1Smrg </listitem> 478994689c1Smrg </varlistentry> 479994689c1Smrg</variablelist> 480994689c1Smrg</para> 481994689c1Smrg<para> 482994689c1Smrg<!-- .LP --> 4835ec34c4cSmrg<link linkend="Text_Functions">See section 5.4</link> 4845ec34c4cSmrgfor a description of <function>XawTextPosition</function>. 485421c997bSmrgThe <xref linkend='XawTextInvalidate' xrefstyle='select: title'/> 486994689c1Smrgfunction causes the specified range of characters to be redisplayed 487994689c1Smrgimmediately if redisplay is enabled or the next time that redisplay is 488994689c1Smrgenabled. 489994689c1Smrg</para> 490994689c1Smrg<para> 491994689c1Smrg<!-- .LP --> 492994689c1Smrg<!-- .sp 1 --> 493421c997bSmrgTo enable redisplay, use <xref linkend='XawTextEnableRedisplay' xrefstyle='select: title'/>: 4945ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextEnableRedisplay</primary></indexterm> 495421c997bSmrg<funcsynopsis id='XawTextEnableRedisplay'> 496994689c1Smrg<funcprototype> 497994689c1Smrg <funcdef>void<function> XawTextEnableRedisplay</function></funcdef> 498994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 499994689c1Smrg</funcprototype> 500994689c1Smrg</funcsynopsis> 501994689c1Smrg<!-- .FN --> 502994689c1Smrg<variablelist> 503994689c1Smrg <varlistentry> 504994689c1Smrg <term> 505994689c1Smrg <emphasis remap='I'>w</emphasis> 506994689c1Smrg </term> 507994689c1Smrg <listitem> 508994689c1Smrg <para> 509994689c1SmrgSpecifies the Text widget. 510994689c1Smrg </para> 511994689c1Smrg </listitem> 512994689c1Smrg </varlistentry> 513994689c1Smrg</variablelist> 514994689c1Smrg</para> 515994689c1Smrg<para> 516994689c1Smrg<!-- .LP --> 517421c997bSmrgThe <xref linkend='XawTextEnableRedisplay' xrefstyle='select: title'/> function flushes any changes due to 518421c997bSmrgbatched updates when <xref linkend='XawTextDisableRedisplay' xrefstyle='select: title'/> 519994689c1Smrgwas called and allows future changes to be reflected immediately. 520994689c1Smrg</para> 521994689c1Smrg<para> 522994689c1Smrg<!-- .LP --> 523994689c1Smrg<!-- .sp 1 --> 524994689c1SmrgTo disable redisplay while making several changes, use 525421c997bSmrg<xref linkend='XawTextDisableRedisplay' xrefstyle='select: title'/>. 5265ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextDisableRedisplay</primary></indexterm> 527421c997bSmrg<funcsynopsis id='XawTextDisableRedisplay'> 528994689c1Smrg<funcprototype> 529994689c1Smrg <funcdef>void<function> XawTextDisableRedisplay</function></funcdef> 530994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 531994689c1Smrg</funcprototype> 532994689c1Smrg</funcsynopsis> 533994689c1Smrg<!-- .FN --> 534994689c1Smrg<variablelist> 535994689c1Smrg <varlistentry> 536994689c1Smrg <term> 537994689c1Smrg <emphasis remap='I'>w</emphasis> 538994689c1Smrg </term> 539994689c1Smrg <listitem> 540994689c1Smrg <para> 541994689c1SmrgSpecifies the Text widget. 542994689c1Smrg </para> 543994689c1Smrg </listitem> 544994689c1Smrg </varlistentry> 545994689c1Smrg</variablelist> 546994689c1Smrg</para> 547994689c1Smrg<para> 548994689c1Smrg<!-- .LP --> 549421c997bSmrgThe <xref linkend='XawTextDisableRedisplay' xrefstyle='select: title'/> function causes all changes to be 550421c997bSmrgbatched until either <xref linkend='XawTextDisplay' xrefstyle='select: title'/> or <xref linkend='XawTextEnableRedisplay' xrefstyle='select: title'/> 551994689c1Smrgis called. 552994689c1Smrg</para> 553994689c1Smrg<para> 554994689c1Smrg<!-- .LP --> 555994689c1Smrg<!-- .sp 1 --> 556421c997bSmrgTo display batched updates, use <xref linkend='XawTextDisplay' xrefstyle='select: title'/>: 5575ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextDisplay</primary></indexterm> 558421c997bSmrg<funcsynopsis id='XawTextDisplay'> 559994689c1Smrg<funcprototype> 560994689c1Smrg <funcdef>void<function> XawTextDisplay</function></funcdef> 561994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 562994689c1Smrg</funcprototype> 563994689c1Smrg</funcsynopsis> 564994689c1Smrg<!-- .FN --> 565994689c1Smrg<variablelist> 566994689c1Smrg <varlistentry> 567994689c1Smrg <term> 568994689c1Smrg <emphasis remap='I'>w</emphasis> 569994689c1Smrg </term> 570994689c1Smrg <listitem> 571994689c1Smrg <para> 572994689c1SmrgSpecifies the Text widget. 573994689c1Smrg </para> 574994689c1Smrg </listitem> 575994689c1Smrg </varlistentry> 576994689c1Smrg</variablelist> 577994689c1Smrg</para> 578994689c1Smrg<para> 579994689c1Smrg<!-- .LP --> 580421c997bSmrgThe <xref linkend='XawTextDisplay' xrefstyle='select: title'/> function forces any accumulated updates to be 581994689c1Smrgdisplayed. 582994689c1Smrg</para> 583994689c1Smrg</sect2> 584994689c1Smrg<sect2 id="Resources_Convenience_Routines"> 585994689c1Smrg<title>Resources Convenience Routines</title> 586994689c1Smrg<para> 587994689c1Smrg<!-- .LP --> 588994689c1SmrgTo obtain the character position of the left-most character on the 589994689c1Smrgfirst line displayed in the widget (the value of the 590421c997bSmrg<function>displayPosition</function> resource), use <xref linkend='XawTextTopPosition' xrefstyle='select: title'/>. 5915ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextTopPosition</primary></indexterm> 592421c997bSmrg<funcsynopsis id='XawTextTopPosition'> 593994689c1Smrg<funcprototype> 594994689c1Smrg <funcdef>XawTextPosition<function> XawTextTopPosition</function></funcdef> 595994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 596994689c1Smrg</funcprototype> 597994689c1Smrg</funcsynopsis> 598994689c1Smrg<!-- .FN --> 599994689c1Smrg<variablelist> 600994689c1Smrg <varlistentry> 601994689c1Smrg <term> 602994689c1Smrg <emphasis remap='I'>w</emphasis> 603994689c1Smrg </term> 604994689c1Smrg <listitem> 605994689c1Smrg <para> 606994689c1SmrgSpecifies the Text widget. 607994689c1Smrg </para> 608994689c1Smrg </listitem> 609994689c1Smrg </varlistentry> 610994689c1Smrg</variablelist> 611994689c1Smrg</para> 612994689c1Smrg<para> 613994689c1Smrg<!-- .LP --> 614994689c1Smrg<!-- .sp 1 --> 615994689c1SmrgTo assign a new selection array to a text widget use 616421c997bSmrg<xref linkend='XawTextSetSelectionArray' xrefstyle='select: title'/>: 6175ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextSetSelectionArray</primary></indexterm> 618421c997bSmrg<funcsynopsis id='XawTextSetSelectionArray'> 619994689c1Smrg<funcprototype> 620994689c1Smrg <funcdef>void<function> XawTextSetSelectionArray</function></funcdef> 621994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 622994689c1Smrg <paramdef>XawTextSelectType*<parameter> sarray</parameter></paramdef> 623994689c1Smrg</funcprototype> 624994689c1Smrg</funcsynopsis> 625994689c1Smrg<!-- .FN --> 626994689c1Smrg<variablelist> 627994689c1Smrg <varlistentry> 628994689c1Smrg <term> 629994689c1Smrg <emphasis remap='I'>w</emphasis> 630994689c1Smrg </term> 631994689c1Smrg <listitem> 632994689c1Smrg <para> 633994689c1SmrgSpecifies the Text widget. 634994689c1Smrg </para> 635994689c1Smrg </listitem> 636994689c1Smrg </varlistentry> 637994689c1Smrg <varlistentry> 638994689c1Smrg <term> 639994689c1Smrg <emphasis remap='I'>sarray</emphasis> 640994689c1Smrg </term> 641994689c1Smrg <listitem> 642994689c1Smrg <para> 6435ec34c4cSmrgSpecifies a selection array as defined in 6445ec34c4cSmrg<xref linkend="Text_Selections_for_Application_Programmers"/>. 645994689c1Smrg </para> 646994689c1Smrg </listitem> 647994689c1Smrg </varlistentry> 648994689c1Smrg</variablelist> 649994689c1Smrg</para> 650994689c1Smrg<para> 651994689c1Smrg<!-- .LP --> 652994689c1SmrgCalling this function is equivalent to setting the value of the 653994689c1Smrg<function>selectionTypes</function> resource. 654994689c1Smrg</para> 655994689c1Smrg<para> 656994689c1Smrg<!-- .LP --> 657994689c1Smrg<!-- .sp 1 --> 658994689c1SmrgTo move the insertion point to the specified source position, use 659421c997bSmrg<xref linkend='XawTextSetInsertionPoint' xrefstyle='select: title'/>: 6605ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextSetInsertionPoint</primary></indexterm> 661421c997bSmrg<funcsynopsis id='XawTextSetInsertionPoint'> 662994689c1Smrg<funcprototype> 663994689c1Smrg <funcdef>void<function> XawTextSetInsertionPoint</function></funcdef> 664994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 665994689c1Smrg <paramdef>XawTextPosition<parameter> position</parameter></paramdef> 666994689c1Smrg</funcprototype> 667994689c1Smrg</funcsynopsis> 668994689c1Smrg<!-- .FN --> 669994689c1Smrg<variablelist> 670994689c1Smrg <varlistentry> 671994689c1Smrg <term> 672994689c1Smrg <emphasis remap='I'>w</emphasis> 673994689c1Smrg </term> 674994689c1Smrg <listitem> 675994689c1Smrg <para> 676994689c1SmrgSpecifies the Text widget. 677994689c1Smrg </para> 678994689c1Smrg </listitem> 679994689c1Smrg </varlistentry> 680994689c1Smrg <varlistentry> 681994689c1Smrg <term> 682994689c1Smrg <emphasis remap='I'>position</emphasis> 683994689c1Smrg </term> 684994689c1Smrg <listitem> 685994689c1Smrg <para> 686994689c1SmrgSpecifies the new position for the insertion point. 687994689c1Smrg </para> 688994689c1Smrg </listitem> 689994689c1Smrg </varlistentry> 690994689c1Smrg</variablelist> 691994689c1Smrg</para> 692994689c1Smrg<para> 693994689c1Smrg<!-- .LP --> 6945ec34c4cSmrg<link linkend="Text_Functions">See section 5.4</link> 6955ec34c4cSmrgfor a description of <function>XawTextPosition</function>. 696994689c1SmrgThe text will be scrolled vertically if necessary to make the line 697994689c1Smrgcontaining the insertion point visible. Calling this function is 698994689c1Smrgequivalent to setting the <function>insertPosition</function> resource. 699994689c1Smrg</para> 700994689c1Smrg<para> 701994689c1Smrg<!-- .LP --> 702994689c1Smrg<!-- .sp 1 --> 703994689c1SmrgTo obtain the current position of the insertion point, use 704421c997bSmrg<xref linkend='XawTextGetInsertionPoint' xrefstyle='select: title'/>: 7055ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextGetInsertionPoint</primary></indexterm> 706421c997bSmrg<funcsynopsis id='XawTextGetInsertionPoint'> 707994689c1Smrg<funcprototype> 708994689c1Smrg <funcdef>XawTextPosition<function> XawTextGetInsertionPoint</function></funcdef> 709994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 710994689c1Smrg</funcprototype> 711994689c1Smrg</funcsynopsis> 712994689c1Smrg<!-- .FN --> 713994689c1Smrg<variablelist> 714994689c1Smrg <varlistentry> 715994689c1Smrg <term> 716994689c1Smrg <emphasis remap='I'>w</emphasis> 717994689c1Smrg </term> 718994689c1Smrg <listitem> 719994689c1Smrg <para> 720994689c1SmrgSpecifies the Text widget. 721994689c1Smrg </para> 722994689c1Smrg </listitem> 723994689c1Smrg </varlistentry> 724994689c1Smrg</variablelist> 725994689c1Smrg</para> 726994689c1Smrg<para> 727994689c1Smrg<!-- .LP --> 7285ec34c4cSmrg<link linkend="Text_Functions">See section 5.4</link> 7295ec34c4cSmrgfor a description of <function>XawTextPosition</function>. 730994689c1SmrgThe result is equivalent to retrieving the value of the 731994689c1Smrg<function>insertPosition</function> resource. 732994689c1Smrg</para> 733994689c1Smrg<para> 734994689c1Smrg<!-- .LP --> 735994689c1Smrg<!-- .sp 1 --> 736994689c1SmrgTo replace the text source in the specified widget, use 737421c997bSmrg<xref linkend='XawTextSetSource' xrefstyle='select: title'/>: 7385ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextSetSource</primary></indexterm> 739421c997bSmrg<funcsynopsis id='XawTextSetSource'> 740994689c1Smrg<funcprototype> 741994689c1Smrg <funcdef>void<function> XawTextSetSource</function></funcdef> 742994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 743994689c1Smrg <paramdef>Widget<parameter> source</parameter></paramdef> 744994689c1Smrg <paramdef>XawTextPosition<parameter> position</parameter></paramdef> 745994689c1Smrg</funcprototype> 746994689c1Smrg</funcsynopsis> 747994689c1Smrg<!-- .FN --> 748994689c1Smrg<variablelist> 749994689c1Smrg <varlistentry> 750994689c1Smrg <term> 751994689c1Smrg <emphasis remap='I'>w</emphasis> 752994689c1Smrg </term> 753994689c1Smrg <listitem> 754994689c1Smrg <para> 755994689c1SmrgSpecifies the Text widget. 756994689c1Smrg </para> 757994689c1Smrg </listitem> 758994689c1Smrg </varlistentry> 759994689c1Smrg <varlistentry> 760994689c1Smrg <term> 761994689c1Smrg <emphasis remap='I'>source</emphasis> 762994689c1Smrg </term> 763994689c1Smrg <listitem> 764994689c1Smrg <para> 765994689c1SmrgSpecifies the text source object. 766994689c1Smrg </para> 767994689c1Smrg </listitem> 768994689c1Smrg </varlistentry> 769994689c1Smrg <varlistentry> 770994689c1Smrg <term> 771994689c1Smrg <emphasis remap='I'>position</emphasis> 772994689c1Smrg </term> 773994689c1Smrg <listitem> 774994689c1Smrg <para> 775994689c1SmrgSpecifies character position that will become the upper left hand corner 776994689c1Smrgof the displayed text. This is usually set to zero. 777994689c1Smrg </para> 778994689c1Smrg </listitem> 779994689c1Smrg </varlistentry> 780994689c1Smrg</variablelist> 781994689c1Smrg</para> 782994689c1Smrg<para> 783994689c1Smrg<!-- .LP --> 7845ec34c4cSmrg<link linkend="Text_Functions">See section 5.4</link> 7855ec34c4cSmrgfor a description of <function>XawTextPosition</function>. 786994689c1SmrgA display update will be performed if redisplay is enabled. 787994689c1Smrg</para> 788994689c1Smrg<para> 789994689c1Smrg<!-- .LP --> 790994689c1Smrg<!-- .sp 1 --> 791994689c1SmrgTo obtain the current text source for the specified widget, use 792421c997bSmrg<xref linkend='XawTextGetSource' xrefstyle='select: title'/>: 7935ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextGetSource</primary></indexterm> 794421c997bSmrg<funcsynopsis id='XawTextGetSource'> 795994689c1Smrg<funcprototype> 796994689c1Smrg <funcdef>Widget<function> XawTextGetSource</function></funcdef> 797994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 798994689c1Smrg</funcprototype> 799994689c1Smrg</funcsynopsis> 800994689c1Smrg<!-- .FN --> 801994689c1Smrg<variablelist> 802994689c1Smrg <varlistentry> 803994689c1Smrg <term> 804994689c1Smrg <emphasis remap='I'>w</emphasis> 805994689c1Smrg </term> 806994689c1Smrg <listitem> 807994689c1Smrg <para> 808994689c1SmrgSpecifies the Text widget. 809994689c1Smrg </para> 810994689c1Smrg </listitem> 811994689c1Smrg </varlistentry> 812994689c1Smrg</variablelist> 813994689c1Smrg</para> 814994689c1Smrg<para> 815994689c1Smrg<!-- .LP --> 816994689c1SmrgThis function returns the text source that this Text widget is currently 817994689c1Smrgusing. 818994689c1Smrg</para> 819994689c1Smrg<para> 820994689c1Smrg<!-- .LP --> 821994689c1Smrg<!-- .sp --> 822994689c1SmrgTo enable and disable the insertion point, use 823421c997bSmrg<xref linkend='XawTextDisplayCaret' xrefstyle='select: title'/>: 8245ec34c4cSmrg<indexterm significance="preferred"><primary>XawTextDisplayCaret</primary></indexterm> 825421c997bSmrg<funcsynopsis id='XawTextDisplayCaret'> 826994689c1Smrg<funcprototype> 827994689c1Smrg <funcdef>void<function> XawTextDisplayCaret</function></funcdef> 828994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 829994689c1Smrg <paramdef>Boolean<parameter> visible</parameter></paramdef> 830994689c1Smrg</funcprototype> 831994689c1Smrg</funcsynopsis> 832994689c1Smrg<!-- .FN --> 833994689c1Smrg<variablelist> 834994689c1Smrg <varlistentry> 835994689c1Smrg <term> 836994689c1Smrg <emphasis remap='I'>w</emphasis> 837994689c1Smrg </term> 838994689c1Smrg <listitem> 839994689c1Smrg <para> 840994689c1SmrgSpecifies the Text widget. 841994689c1Smrg </para> 842994689c1Smrg </listitem> 843994689c1Smrg </varlistentry> 844994689c1Smrg <varlistentry> 845994689c1Smrg <term> 846994689c1Smrg <emphasis remap='I'>visible</emphasis> 847994689c1Smrg </term> 848994689c1Smrg <listitem> 849994689c1Smrg <para> 850994689c1SmrgSpecifies whether or not the caret should be displayed. 851994689c1Smrg </para> 852994689c1Smrg </listitem> 853994689c1Smrg </varlistentry> 854994689c1Smrg</variablelist> 855994689c1Smrg</para> 856994689c1Smrg<para> 857994689c1Smrg<!-- .LP --> 858994689c1SmrgIf <function>visible</function> is <function>False</function> the insertion point will be disabled. 859994689c1SmrgThe marker is re-enabled either by setting <function>visible</function> to <function>True</function>, by 860421c997bSmrgcalling <xref linkend='XtSetValues' xrefstyle='select: title'/>, or by executing the <function>display-caret</function> 861994689c1Smrgaction routine. 862994689c1Smrg</para> 863994689c1Smrg</sect2> 864994689c1Smrg</sect1> 865