1XmTextReplace(library call) XmTextReplace(library call)
2
3
4
6 XmTextReplace — A Text function that replaces part of a text string
7
9 #include <Xm/Text.h>
10 void XmTextReplace(
11 Widget widget,
12 XmTextPosition from_pos,
13 XmTextPosition to_pos,
14 char * value);
15
17 XmTextReplace replaces part of the text string in the Text widget. The
18 character positions begin at 0 (zero) and are numbered sequentially
19 from the beginning of the text.
20
21 An example text replacement would be to replace the second and third
22 characters in the text string. To accomplish this, the parameter
23 from_pos must be 1 and to_pos must be 3. To insert a string after the
24 fourth character, both parameters, from_pos and to_pos, must be 4.
25
26 This routine calls the widget's XmNvalueChangedCallback and verifica‐
27 tion callbacks, either XmNmodifyVerifyCallback or XmNmodifyVerifyCall‐
28 backWcs, or both. If both verification callback lists are registered,
29 the procedures of the XmNmodifyVerifyCallback list are executed first
30 and the resulting data is passed to the XmNmodifyVerifyCallbackWcs
31 callbacks. The XmNmotionVerifyCallback is generated if to_pos is less
32 than or equal to the cursor position and the length of value is not the
33 same as the length of the text being replaced, or if the cursor posi‐
34 tion is between from_pos and to_pos, and the distance from the cursor
35 position to from_pos is greater than the length of value.
36
37 widget Specifies the Text widget ID
38
39 from_pos Specifies the start position of the text to be replaced
40
41 to_pos Specifies the end position of the text to be replaced
42
43 value Specifies the character string value to be added to the text
44 widget
45
46 For a complete definition of Text and its associated resources, see
47 XmText(3).
48
50 XmText(3) and XmTextReplaceWcs(3).
51
52
53
54 XmTextReplace(library call)