BSD 4_3_Reno release
[unix-history] / usr / src / share / doc / ps1 / 18.curses / doc.I
CommitLineData
ea56bb60
KB
1.\" Copyright (c) 1980 The Regents of the University of California.
2.\" All rights reserved.
4107bd96 3.\"
ea56bb60
KB
4.\" Redistribution and use in source and binary forms are permitted
5.\" provided that the above copyright notice and this paragraph are
6.\" duplicated in all such forms and that any documentation,
7.\" advertising materials, and other materials related to such
8.\" distribution and use acknowledge that the software was developed
9.\" by the University of California, Berkeley. The name of the
10.\" University may not be used to endorse or promote products derived
11.\" from this software without specific prior written permission.
12.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15.\"
1c15e888 16.\" @(#)doc.I 6.2 (Berkeley) 3/17/89
4107bd96
KM
17.\"
18.Ds
19.Fd addch ch \*m
20char ch;
4107bd96
KM
21.Fd waddch win\*,ch
22WINDOW *win;
23char ch;
24.De
25Add the character
26.Vn ch
27on the window
28at the current \*y.
29If the character is a newline
30(\'\en\')
31the line will be cleared to the end,
32and the current \*y will be changed to the
33beginning off the next line
34if newline mapping is on,
35or to the next line at the same x co-ordinate
36if it is off.
37A return
38(\'\er\')
39will move to the beginning of the line on the window.
40Tabs
41(\'\et\')
42will be expanded into spaces
43in the normal tabstop positions of
44every eight characters.
45\*(Es
46.Ds
47.Fd addstr str \*m
48char *str;
4107bd96
KM
49.Fd waddstr win\*,str
50WINDOW *win;
51char *str;
52.De
53Add the string pointed to by
54.Vn str
55on the window at the current \*y.
56\*(Es
57In this case, it will put on as much as it can.
58.Ds
59.Fd box win\*,vert\*,hor
60WINDOW *win;
61char vert\*,hor;
62.De
63.Pp
64Draws a box around the window using
65.Vn vert
66as the character for drawing the vertical sides, and
67.Vn hor
68for drawing the horizontal lines.
69If scrolling is not allowed,
70and the window encompasses the lower right-hand corner of the terminal,
71the corners are left blank to avoid a scroll.
72.Ds
73.Fd clear "" \*m
4107bd96
KM
74.Fd wclear win
75WINDOW *win;
76.De
77Resets the entire window to blanks.
78If
79.Vn win
80is a screen,
81this sets the clear flag,
82which will cause a clear-screen sequence to be sent
83on the next
84.Fn refresh
85call.
86This also moves the current \*y
87to (0\*,0).
88.Ds
89.Fd clearok scr\*,boolf \*m
90WINDOW *scr;
91bool boolf;
92.De
93Sets the clear flag for the screen
94.Vn scr .
95If
96.Vn boolf
97is TRUE,
98this will force a clear-screen to be printed on the next
99.Fn refresh ,
100or stop it from doing so if
101.Vn boolf
102is FALSE.
103This only works on screens,
104and,
105unlike
106.Fn clear ,
107does not alter the contents of the screen.
108If
109.Vn scr
110is
111.Vn curscr ,
112the next
113.Fn refresh
114call will cause a clear-screen,
115even if the window passed to
116.Fn refresh
117is not a screen.
118.Ds
119.Fd clrtobot "" \*m
4107bd96
KM
120.Fd wclrtobot win
121WINDOW *win;
122.De
123Wipes the window clear from the current \*y to the bottom.
124This does not force a clear-screen sequence on the next refresh
125under any circumstances.
126\*(Nm
127.Ds
128.Fd clrtoeol "" \*m
4107bd96
KM
129.Fd wclrtoeol win
130WINDOW *win;
131.De
132Wipes the window clear from the current \*y to the end of the line.
133\*(Nm
134.Ds
135.Fd delch
4107bd96
KM
136.Fd wdelch win
137WINDOW *win;
138.De
139Delete the character at the current \*y.
140Each character after it on the line shifts to the left,
141and the last character becomes blank.
142.Ds
143.Fd deleteln
4107bd96
KM
144.Fd wdeleteln win
145WINDOW *win;
146.De
147Delete the current line.
148Every line below the current one will move up,
149and the bottom line will become blank.
150The current \*y will remain unchanged.
151.Ds
152.Fd erase "" \*m
4107bd96
KM
153.Fd werase win
154WINDOW *win;
155.De
156Erases the window to blanks without setting the clear flag.
157This is analagous to
158.Fn clear ,
159except that it never causes a clear-screen sequence to be generated
160on a
161.Fn refresh .
162\*(Nm
163.Ds
73eb5d1c
KM
164.Fd flushok win\*,boolf \*m
165WINDOW *win;
166bool boolf;
167.De
168Normally,
169.Fn refresh
170.Fn fflush 's
171.Vn stdout
172when it is finished.
173.Fn flushok
174allows you to control this.
175if
176.Vn boolf
177is TRUE
178(\c
179.i i.e. ,
180non-zero)
181it will do the
182.Fn fflush ;
183if it is FALSE.
184it will not.
185.Ds
186.Fd idlok win\*,boolf
187WINDOW *win;
188bool boolf;
189.De
190Reserved for future use.
191This will eventually signal to
192.Fn refresh
193that it is all right to use the insert and delete line sequences
194when updating the window.
195.Ds
4107bd96
KM
196.Fd insch c
197char c;
4107bd96
KM
198.Fd winsch win\*,c
199WINDOW *win;
200char c;
201.De
202Insert
203.Vn c
204at the current \*y
205Each character after it shifts to the right,
206and the last character disappears.
207\*(Es
208.Ds
209.Fd insertln
4107bd96
KM
210.Fd winsertln win
211WINDOW *win;
212.De
213Insert a line above the current one.
214Every line below the current line
215will be shifted down,
216and the bottom line will disappear.
217The current line will become blank,
218and the current \*y will remain unchanged.
4107bd96
KM
219.Ds
220.Fd move y\*,x \*m
221int y\*,x;
4107bd96
KM
222.Fd wmove win\*,y\*,x
223WINDOW *win;
224int y\*,x;
225.De
226Change the current \*y of the window to
227.Vn y\*,x ). (
228\*(Es
229.Ds
230.Fd overlay win1\*,win2
231WINDOW *win1\*,*win2;
232.De
233Overlay
234.Vn win1
235on
236.Vn win2 .
237The contents of
238.Vn win1 ,
239insofar as they fit,
240are placed on
241.Vn win2
242at their starting \*y.
243This is done non-destructively,
244i.e., blanks on
245.Vn win1
246leave the contents of the space on
247.Vn win2
248untouched.
249.Ds
250.Fd overwrite win1\*,win2
251WINDOW *win1\*,*win2;
252.De
253Overwrite
254.Vn win1
255on
256.Vn win2 .
257The contents of
258.Vn win1 ,
259insofar as they fit,
260are placed on
261.Vn win2
262at their starting \*y.
263This is done destructively,
73eb5d1c
KM
264.i i.e. ,
265blanks on
4107bd96
KM
266.Vn win1
267become blank on
268.Vn win2 .
269.Ds
270.Fd printw fmt\*,arg1\*,arg2\*,...
271char *fmt;
4107bd96
KM
272.Fd wprintw win\*,fmt\*,arg1\*,arg2\*,...
273WINDOW *win;
274char *fmt;
275.De
276Performs a
277.Fn printf
278on the window starting at the current \*y.
279It uses
280.Fn addstr
281to add the string on the window.
282It is often advisable to use the field width options of
283.Fn printf
284to avoid leaving things on the window from earlier calls.
285\*(Es
286.Ds
287.Fd refresh "" \*m
4107bd96
KM
288.Fd wrefresh win
289WINDOW *win;
290.De
291Synchronize the terminal screen with the desired window.
292If the window is not a screen,
293only that part covered by it is updated.
294\*(Es
295In this case, it will update whatever it can
296without causing the scroll.
73eb5d1c
KM
297.sp
298As a special case,
299if
300.Fn wrefresh
301is called with the window
302.Vn curscr
303the screen is cleared
304and repainted as it is currently.
305This is very useful for allowing the redrawing of the screen
306when the user has garbage dumped on his terminal.
4107bd96
KM
307.Ds
308.Fd standout "" \*m
4107bd96
KM
309.Fd wstandout win
310WINDOW *win;
4107bd96 311.Fd standend "" \*m
4107bd96
KM
312.Fd wstandend win
313WINDOW *win;
314.De
315Start and stop putting characters onto
316.i win
317in standout mode.
318.Fn standout
319causes any characters added to the window
320to be put in standout mode on the terminal
321(if it has that capability).
322.Fn standend
323stops this.
324The sequences
325.Vn SO
326and
327.Vn SE
328(or
329.Vn US
330and
331.Vn UE
332if they are not defined)
333are used (see Appendix A).