1XmTextFieldGetSubstring(library call)    XmTextFieldGetSubstring(library call)
2
3
4

NAME

6       XmTextFieldGetSubstring — A TextField function that retrieves a copy of
7       a portion of the internal text buffer
8

SYNOPSIS

10       #include <Xm/TextF.h>
11       int XmTextFieldGetSubstring(
12       Widget widget,
13       XmTextPosition start,
14       int num_chars,
15       int buffer_size,
16       char *buffer);
17

DESCRIPTION

19       XmTextFieldGetSubstring retrieves a copy of a portion of  the  internal
20       text buffer of a TextField widget. The function copies a specified num‐
21       ber of characters from a given start position in the internal text buf‐
22       fer  into  a  buffer provided by the application.  A NULL terminator is
23       placed at the end of the copied data.
24
25       The size of the required buffer depends on the maximum number of  bytes
26       per  character  (MB_CUR_MAX)  for  the current locale.  MB_CUR_MAX is a
27       macro defined in stdlib.h. The buffer should be large enough to contain
28       the  substring  to  be  copied and a NULL terminator. Use the following
29       equation to calculate the size of buffer the  application  should  pro‐
30       vide:
31
32       buffer_size = (num_chars* MB_CUR_MAX) + 1
33       (void)
34
35       widget    Specifies the TextField widget ID.
36
37       start     Specifies  the  beginning  character  position from which the
38                 data will be retrieved. This is an integer number of  charac‐
39                 ters from the beginning of the text buffer. The first charac‐
40                 ter position is 0 (zero).
41
42       num_chars Specifies the number of characters to be copied into the pro‐
43                 vided buffer.
44
45       buffer_size
46                 Specifies the size of the supplied buffer in bytes. This size
47                 should account for a NULL terminator.
48
49       buffer    Specifies the character buffer into which the  internal  text
50                 buffer will be copied.
51
52       For  a  complete  definition of TextField and its associated resources,
53       see XmTextField(3).
54

RETURN

56       XmCOPY_SUCCEEDED
57                 The function was successful.
58
59       XmCOPY_FAILED
60                 The function failed because it was unable to copy the  speci‐
61                 fied number of characters into the buffer provided.  The buf‐
62                 fer size may be insufficient.  The  contents  of  buffer  are
63                 undefined.
64
65       XmCOPY_TRUNCATED
66                 The requested number of characters extended beyond the inter‐
67                 nal buffer. The function copied characters between start  and
68                 the end of the widget's buffer and terminated the string with
69                 a NULL  terminator;  fewer  than  num_chars  characters  were
70                 copied.
71
73       XmTextField(3) and XmTextFieldGetSubstringWcs(3).
74
75
76
77                                         XmTextFieldGetSubstring(library call)
Impressum