|
|
1.1 root 1:
2:
3:
4: XTEXT(3X) UNIX Programmer's Manual XTEXT(3X)
5:
6:
7:
8: NAME
9: Xtext - routines to provide simple text output windows
10:
11: SYNOPSIS
12: #include <X/Xtext.h>
13:
14: TextWindow *TextCreate(width, height, x, y, parent,
15: fontname, bwidth, fgpixel, bgpixel,
16: bordercolor, fastscroll);
17: int height, width, x, y, bwidth, fgpixel, bgpixel,
18: fastscroll;
19: Window parent;
20: char *fontname;
21: Pixmap bordercolor;
22:
23: TextDestroy(t);
24: TextWindow *t;
25:
26: TextClear(t);
27: TextWindow *t;
28:
29: TextRedisplay(t);
30: TextWindow *t;
31:
32: int TextEvent(t, e);
33: TextWindow *t;
34: XEvent *e;
35:
36: TextPutString(t, str);
37: TextWindow *t;
38: char *str;
39:
40: TextPutChar(t, ch);
41: TextWindow *t;
42: char ch;
43:
44: TextPrintf(t, format [ , arg ] ... )
45: TextWindow *t;
46: char *format;
47:
48: TextFlush(t);
49: TextWindow *t;
50:
51: DESCRIPTION
52: These functions provide a simple interface to text output
53: windows.
54:
55: _T_e_x_t_C_r_e_a_t_e creates a window that is _w_i_d_t_h characters wide
56: and _h_e_i_g_h_t characters high. It is located with its upper
57: left hand corner located at the point _x, _y in the window
58: _p_a_r_e_n_t. The foreground (i.e. the characters) is in the color
59: _f_g_p_i_x_e_l and the background is the color _b_g_p_i_x_e_l. The border
60:
61:
62:
63: Printed 9/15/87 April 10 1986 1
64:
65:
66:
67:
68:
69:
70: XTEXT(3X) UNIX Programmer's Manual XTEXT(3X)
71:
72:
73:
74: is _b_w_i_d_t_h pixels wide and filled with the Pixmap _b_o_r_d_e_r_-
75: _c_o_l_o_r. If _f_a_s_t_s_c_r_o_l_l is nonzero, text containing multiple
76: newlines is displayed with a single jump scroll rather than
77: with a single scroll for each newline.
78:
79: The structure _T_e_x_t_W_i_n_d_o_w is defined in
80: /_u_s_r/_i_n_c_l_u_d_e/_X/_X_t_e_x_t._h. The only field that should be of
81: interest to most applications is _w, the X Window id of the
82: created window. This is quite useful if the application
83: wishes to map the created window.
84:
85: _T_e_x_t_D_e_s_t_r_o_y destroys the window described by its argument.
86: The window is also destroyed automatically if the process
87: creating it is terminated.
88:
89: _T_e_x_t_C_l_e_a_r clears the window described by its argument.
90:
91: _T_e_x_t_R_e_d_i_s_p_l_a_y redisplays the window described by its argu-
92: ment. If the argument is NULL, all active text windows are
93: redisplayed.
94:
95: _T_e_x_t_E_v_e_n_t handles the event passed to it. It returns 0 if
96: it was an event the library knows how to deal with, and 1 if
97: it was an event of an unknown type; the latter should only
98: happen if the application has changed the event mask for the
99: window. Any event that the application receives that has as
100: its _w_i_n_d_o_w the window id of the text window should be passed
101: to _T_e_x_t_E_v_e_n_t for handling. Scrolling text generates an
102: event per line of events, so the application should check
103: for them frequently. An alternative routine, _T_e_x_t_F_l_u_s_h, can
104: be used to handle all outstanding events for all active text
105: windows.
106:
107: _T_e_x_t_P_u_t_S_t_r_i_n_g prints its string in its window. The charac-
108: ter '\n' (newline) is treated specially, and any other char-
109: acter is taken from the font. If the string contains multi-
110: ple newlines, a single scroll is done for each line unless
111: the _f_a_s_t_s_c_r_o_l_l argument was non-zero in the call to
112: _T_e_x_t_C_r_e_a_t_e.
113:
114: _T_e_x_t_P_u_t_C_h_a_r is similar to _T_e_x_t_P_u_t_S_t_r_i_n_g but only prints a
115: single character. Again, newline is treated specially.
116:
117: _T_e_x_t_P_r_i_n_t_f is similar to the standard function _p_r_i_n_t_f except
118: that it prints its result in the specified window. The
119: resulting string is passed to _T_e_x_t_P_u_t_S_t_r_i_n_g. See also the
120: BUGS section at the end of this page.
121:
122: _T_e_x_t_F_l_u_s_h is analogous to the stdio function _f_f_l_u_s_h in that
123: it causes all outstanding output requests to be flushed to
124: the specified window. If the argument is NULL, all windows
125: are flushed. For novice X developers, this routine
126:
127:
128:
129: Printed 9/15/87 April 10 1986 2
130:
131:
132:
133:
134:
135:
136: XTEXT(3X) UNIX Programmer's Manual XTEXT(3X)
137:
138:
139:
140: eliminates the need for event handling from X applications.
141:
142: SEE ALSO
143: printf(3S), xterm(1), X(8C)
144:
145: AUTHORS
146: Paul Asente, Stanford University; Mark Colan, MIT Project
147: Athena/IBM
148:
149: BUGS
150: _T_e_x_t_P_r_i_n_t_f will truncate the output if the resulting string
151: is more than 2048 characters long.
152:
153: Since X operates asynchronously, it is possible to get way
154: ahead of the server. This means that it may be quite a
155: while between when a scroll happens on the screen and when
156: _X_t_e_x_t gets around to filling in areas that couldn't be
157: scrolled normally. This should only happen if the applica-
158: tion issues a great many output requests very quickly, or if
159: it doesn't get around to receiving the events _X_t_e_x_t needs to
160: fill these areas in. Also, some strange TCP bugs are
161: invoked if an application which has gotten far ahead of the
162: X server is stopped (as with a control-Z).
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: Printed 9/15/87 April 10 1986 3
196:
197:
198:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.