blob: bb2109d572371172ea46651a36ff7af9965f29f9 [file] [log] [blame]
Fred Drakea4070ce1999-06-21 21:13:09 +00001\section{\module{curses} ---
Thomas Woutersf8316632000-07-16 19:01:10 +00002 Terminal independent console handling}
Fred Drakea4070ce1999-06-21 21:13:09 +00003
4\declaremodule{extension}{curses}
5\sectionauthor{Moshe Zadka}{mzadka@geocities.com}
6\modulesynopsis{An interface to the curses library.}
7
8The \module{curses} module provides an interface to the curses \UNIX{}
9library, the de-facto standard for portable advanced terminal
10handling.
11
12While curses is most widely used in the \UNIX{} environment, versions
13are available for DOS, OS/2, and possibly other systems as well. The
14extension module has not been tested with all available versions of
15curses.
16
17\begin{seealso}
Fred Drake5c529d32000-06-28 22:11:40 +000018 \seemodule{curses.ascii}{Utilities for working with \ASCII{}
19 characters, regardless of your locale
20 settings.}
Fred Drakea4070ce1999-06-21 21:13:09 +000021 \seetext{Tutorial material on using curses with Python is available
Fred Drake37f15741999-11-10 16:21:37 +000022 on the Python Web site as Andrew Kuchling's
23\citetitle[http://www.python.org/doc/howto/curses/curses.html]{Curses
Fred Drakea4070ce1999-06-21 21:13:09 +000024 Programming with Python}, at
25 \url{http://www.python.org/doc/howto/curses/curses.html}.}
26\end{seealso}
27
28
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +000029\subsection{Functions \label{curses-functions}}
Fred Drakea4070ce1999-06-21 21:13:09 +000030
31The module \module{curses} defines the following exception:
32\begin{excdesc}{error}
33Curses function returned an error status.
34\end{excdesc}
35
Fred Drake0bccd731999-06-23 17:28:01 +000036\strong{Note:} Whenever \var{x} or \var{y} arguments to a function
37or a method are optional, they default to the current cursor location.
38Whenever \var{attr} is optional, it defaults to \constant{A_NORMAL}.
39
Fred Drakea4070ce1999-06-21 21:13:09 +000040The module \module{curses} defines the following functions:
41
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +000042\begin{funcdesc}{baudrate}{}
43Returns the output speed of the terminal in bits per second.
44\end{funcdesc}
45
46\begin{funcdesc}{beep}{}
47Emit a short sound.
48\end{funcdesc}
49
50\begin{funcdesc}{can_change_color}{}
51Returns true or false, depending on whether the programmer can change
52the colors displayed by the terminal.
53\end{funcdesc}
54
55\begin{funcdesc}{cbreak}{}
56Enter cbreak mode.
57\end{funcdesc}
58
59\begin{funcdesc}{color_content}{color_number}
60Returns the intensity of the red, green, and blue (RGB) components in
61the color \var{color_number}, which must be between 0 and COLORS. A
623-tuple is returned, containing the R,G,B values for the given color,
63which will be between 0 (no component) and 1000 (maximum amount of
64component).
65\end{funcdesc}
66
67\begin{funcdesc}{color_pair}{color_number}
68Returns the attribute value for displaying text in the specified
69color. This attribute value can be combined with
70\constant{A_STANDOUT}, \constant{A_REVERSE}, and the other
71\constant{A_*} attributes. \function{pair_number()} is the counterpart to this function.
72\end{funcdesc}
73
74\begin{funcdesc}{curs_set}{visibility}
75Sets the cursor state. \var{visibility} can be set to 0, 1, or 2, for
76invisible, normal, or very visible. If the terminal supports the
77visibility requested, the previous cursor state is returned;
78otherwise, an exception is raised.
79\end{funcdesc}
80
81\begin{funcdesc}{def_prog_mode}{}
82Saves the current terminal mode as the ``program'' mode, the mode when
83the running program is using curses. (Its counterpart is the
84``shell'' mode, for when the program is not in curses.) Subsequent calls
85to \function{reset_prog_mode()} will restore this mode.
86\end{funcdesc}
87
88\begin{funcdesc}{def_shell_mode}{}
89Saves the current terminal mode as the ``shell'' mode, the mode when
90the running program is not using curses. (Its counterpart is the
91``program'' mode, when the program is using curses capabilities.)
92Subsequent calls
93to \function{reset_shell_mode()} will restore this mode.
94\end{funcdesc}
95
96\begin{funcdesc}{delay_output}{ms}
97Inserts an \var{ms} millisecond pause in output.
98\end{funcdesc}
99
100\begin{funcdesc}{doupdate}{}
101Update the screen.
102\end{funcdesc}
103
104\begin{funcdesc}{echo}{}
105Enter echo mode.
Fred Drakea4070ce1999-06-21 21:13:09 +0000106\end{funcdesc}
107
108\begin{funcdesc}{endwin}{}
109De-initialize the library, and return terminal to normal status.
110\end{funcdesc}
111
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000112\begin{funcdesc}{erasechar}{}
113Returns the user's current erase character.
114\end{funcdesc}
115
116\begin{funcdesc}{filter}{}
117The \function{filter()} routine, if used, must be called before
118\function{initscr()} is called.
119
120The effect is that, during those calls, LINES is set to 1; the
121capabilities clear, cup, cud, cud1, cuu1, cuu, vpa are disabled; and
122the home string is set to the value of cr.
123\end{funcdesc}
124
125\begin{funcdesc}{flash}{}
126Flash the screen.
127\end{funcdesc}
128
129\begin{funcdesc}{flushinp}{}
130Flush all input buffers.
131\end{funcdesc}
132
Andrew M. Kuchlingefc43d42000-06-30 01:05:39 +0000133\begin{funcdesc}{getmouse}{}
134After \method{getch()} returns \constant{KEY_MOUSE} to signal a mouse
135event, this method should be call to retrieve the queued mouse event,
136represented as a 5-tuple
137\code{(\var{id}, \var{x}, \var{y}, \var{z}, \var{bstate})}.
138\var{id} is an ID value used to distinguish multiple devices,
139and \var{x}, \var{y}, \var{z} are the event's coordinates. (\var{z}
140is currently unused.). \var{bstate} is an integer value whose bits
141will be set to indicate the type of event, and will be the bitwise OR
142of one or more of the following constants, where \var{n} is the button
143number from 1 to 4:
144\constant{BUTTON\var{n}_PRESSED},
145\constant{BUTTON\var{n}_RELEASED},
146\constant{BUTTON\var{n}_CLICKED},
147\constant{BUTTON\var{n}_DOUBLE_CLICKED},
148\constant{BUTTON\var{n}_TRIPLE_CLICKED},
149\constant{BUTTON_SHIFT},
150\constant{BUTTON_CTRL},
151\constant{BUTTON_ALT}.
152\end{funcdesc}
153
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000154\begin{funcdesc}{getsyx}{}
155Returns the current coordinates of the virtual screen cursor in y and
156x. If leaveok is currently true, then -1,-1 is returned.
157\end{funcdesc}
158
159\begin{funcdesc}{getwin}{file}
160Reads window related data stored in the file by an earlier
161\function{putwin()} call. The routine then creates and initializes a
162new window using that data, returning the new window object.
163\end{funcdesc}
164
165\begin{funcdesc}{has_colors}{}
166Returns true if the terminal can manipulate colors; otherwise, it
167returns false.
168\end{funcdesc}
169
170\begin{funcdesc}{has_ic}{}
171Returns true if the terminal has insert- and delete- character
172capabilities.
173\end{funcdesc}
174
175\begin{funcdesc}{has_il}{}
176Returns true if the terminal has insert- and
177delete-line capabilities, or can simulate them using
178scrolling regions.
179\end{funcdesc}
180
181\begin{funcdesc}{has_key}{ch}
182Takes a key value \var{ch}, and returns true if the current terminal
183type recognizes a key with that value.
184\end{funcdesc}
185
186\begin{funcdesc}{halfdelay}{tenths}
187Used for half-delay mode, which is similar to cbreak mode in that
188characters typed by the user are immediately available to the program.
189However, after blocking for \var{tenths} tenths of seconds, an
190exception is raised if nothing has been typed. The value of
191\var{tenths} must be a number between 1 and 255. Use nocbreak to
192leave half-delay mode.
193\end{funcdesc}
194
195\begin{funcdesc}{init_color}{color_number, r, g, b}
196Changes the definition of a color, taking the number of the color to
197be changed followed by three RGB values (for the amounts of red,
198green, and blue components). The value of \var{color_number} must be
199between 0 and COLORS. Each of \var{r}, \var{g}, \var{b}, must be a
200value between 0 and 1000. When \function{init_color()} is used, all
201occurrences of that color on the screen immediately change to the new
202definition.
203\end{funcdesc}
204
205\begin{funcdesc}{init_pair}{pair_number, fg, bg}
206Changes the definition of a color-pair. It takes three arguments: the
207number of the color-pair to be changed, the foreground color number,
208and the background color number. The value of \var{pair_number} must
209be between 1 and COLOR_PAIRS-1 (the 0 color pair is wired to white on
210black and cannot be changed). The value of \var{fg} and \var{bg}
211arguments must be between 0 and COLORS. If the color-pair was
212previously initialized, the screen is refreshed and all occurrences of
213that color-pair are changed to the new definition.
214\end{funcdesc}
215
216\begin{funcdesc}{initscr}{}
217Initialize the library. Returns a \class{WindowObject} which represents
218the whole screen.
219\end{funcdesc}
220
Fred Drakea4070ce1999-06-21 21:13:09 +0000221\begin{funcdesc}{isendwin}{}
222Returns true if \function{endwin()} has been called.
223\end{funcdesc}
224
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000225\begin{funcdesc}{keyname}{k}
226Return the name of the key numbered \var{k}.
227\end{funcdesc}
228
229\begin{funcdesc}{killchar}{}
230Returns the user's current line kill character.
231\end{funcdesc}
232
233\begin{funcdesc}{longname}{}
234Returns a string containing a verbose description of the current
235terminal. The maximum length of a verbose description is 128
236characters. It is defined only after the call to
237\function{initscr()}.
238\end{funcdesc}
239
240\begin{funcdesc}{meta}{yes}
241If \var{yes} is 1, allow 8-bit characters. If \var{yes} is 0,
242allow only 7-bit chars.
243\end{funcdesc}
244
Andrew M. Kuchlingefc43d42000-06-30 01:05:39 +0000245\begin{funcdesc}{mouseinterval}{interval}
Thomas Woutersf8316632000-07-16 19:01:10 +0000246Sets the maximum time in milliseconds that can elapse between press and
Andrew M. Kuchlingefc43d42000-06-30 01:05:39 +0000247release events in order for them to be recognized as a click, and
248returns the previous interval value. The default value is 200 msec,
249or one fifth of a second.
250\end{funcdesc}
251
252\begin{funcdesc}{mousemask}{mousemask}
253Sets the mouse events to be reported, and returns a tuple
254\code{(\var{availmask}, \var{oldmask})}.
255\var{availmask} indicates which of the
256specified mouse events can be reported; on complete failure it returns
2570. \var{oldmask} is the previous value of the given window's mouse
258event mask. If this function is never called, no mouse events are
259ever reported.
260\end{funcdesc}
261
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000262\begin{funcdesc}{newpad}{nlines, ncols}
263Creates and returns a pointer to a new pad data structure with the
264given number of lines and columns. A pad is returned as a
265window object.
266
267A pad is like a window,
268except that it is not restricted by the screen size, and is not
269necessarily associated with a particular part of the screen.
270Pads can be used when a large window is needed, and only a part
271of the window will be on the screen at one time. Automatic
272refreshes of pads (e.g., from scrolling or echoing of
273 input) do not occur. It is not legal to call wrefresh
274 with a pad as an argument; the routines prefresh or
275 pnoutrefresh should be called instead. Note that these
276 routines require additional parameters to specify the part of
277 the pad to be displayed and the location on the screen to be
278 used for the display.
279
Fred Drakea4070ce1999-06-21 21:13:09 +0000280\end{funcdesc}
281
282\begin{funcdesc}{newwin}{\optional{nlines, ncols,} begin_y, begin_x}
283Return a new window, whose left-upper corner is at
284\code{(\var{begin_y}, \var{begin_x})}, and whose height/width is
Fred Drake0bccd731999-06-23 17:28:01 +0000285\var{nlines}/\var{ncols}.
286
287By default, the window will extend from the
Fred Drakea4070ce1999-06-21 21:13:09 +0000288specified position to the lower right corner of the screen.
289\end{funcdesc}
290
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000291\begin{funcdesc}{nl}{}
292Enter nl mode.
Fred Drakea4070ce1999-06-21 21:13:09 +0000293\end{funcdesc}
294
295\begin{funcdesc}{nocbreak}{}
296Leave cbreak mode.
297\end{funcdesc}
298
Fred Drakea4070ce1999-06-21 21:13:09 +0000299\begin{funcdesc}{noecho}{}
300Leave echo mode.
301\end{funcdesc}
302
Fred Drakea4070ce1999-06-21 21:13:09 +0000303\begin{funcdesc}{nonl}{}
304Leave nl mode.
305\end{funcdesc}
306
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000307\begin{funcdesc}{noqiflush}{}
308 When the noqiflush routine is used, normal flush of input and
309 output queues associated with the INTR, QUIT and SUSP
310 characters will not be done. You may want to call
311 \function{noqiflush()} in a signal handler if you want output
312 to continue as though the interrupt had not occurred, after the
313 handler exits.
Fred Drakea4070ce1999-06-21 21:13:09 +0000314\end{funcdesc}
315
316\begin{funcdesc}{noraw}{}
317Leave raw mode.
318\end{funcdesc}
319
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000320\begin{funcdesc}{pair_content}{pair_number}
321Returns a tuple \var{(fg,bg)} containing the colors for the requested
322color pair. The value of \var{pair_number} must be between 0 and
323COLOR_PAIRS-1.
Fred Drakea4070ce1999-06-21 21:13:09 +0000324\end{funcdesc}
325
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000326\begin{funcdesc}{pair_number}{attr}
327Returns the number of the color-pair set by the attribute value \var{attr}.
328\function{color_pair()} is the counterpart to this function.
Fred Drakea4070ce1999-06-21 21:13:09 +0000329\end{funcdesc}
330
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000331\begin{funcdesc}{putp}{string}
332Equivalent to \code{tputs(str, 1, putchar)}. Note that the output of putp always
333goes to standard output.
334\end{funcdesc}
335
336\begin{funcdesc}{qiflush}{ \optional{flag} }
337If \var{flag} is false, the effect is the same as calling
338\function{noqiflush()}. If \var{flag} is true, or no argument is
339provided, the queues will be flushed when these control characters are
340read.
341\end{funcdesc}
342
343\begin{funcdesc}{raw}{}
344Enter raw mode.
345\end{funcdesc}
346
347\begin{funcdesc}{reset_prog_mode}{}
348Restores the terminal to ``program'' mode, as previously saved
349by \function{def_prog_mode()}.
350\end{funcdesc}
351
352\begin{funcdesc}{reset_shell_mode}{}
353Restores the terminal to ``shell'' mode, as previously saved
354by \function{def_shell_mode()}.
355\end{funcdesc}
356
357\begin{funcdesc}{setsyx}{y, x}
358Sets the virtual screen cursor to \var{y}, \var{x}.
359If \var{y} and \var{x} are both -1, then leaveok is set.
360\end{funcdesc}
361
362\begin{funcdesc}{start_color}{}
363Must be called if the programmer wants to use colors, and before any
364other color manipulation routine is called. It is good
365practice to call this routine right after \function{initscr()}.
366
367\function{start_color()} initializes eight basic colors (black, red,
368green, yellow, blue, magenta, cyan, and white), and two global
369variables in the \module{curses} module, COLORS and COLOR_PAIRS,
370containing the maximum number of colors and color-pairs the terminal
371can support. It also restores the colors on the terminal to the
372values they had when the terminal was just turned on.
373\end{funcdesc}
374
375\begin{funcdesc}{termattrs}{}
376Returns a logical OR of all video attributes supported by the
377terminal. This information is useful when a curses program needs
378complete control over the appearance of the screen.
379\end{funcdesc}
380
381\begin{funcdesc}{termname}{}
382Returns the value of the environment variable TERM, truncated to 14
383characters.
384\end{funcdesc}
385
Andrew M. Kuchlingd24ff442000-06-21 01:42:51 +0000386\begin{funcdesc}{typeahead}{fd}
387Specifies that the file descriptor \var{fd} be used for typeahead
388checking. If \var{fd} is -1, then no typeahead checking is done.
389
390The curses library does ``line-breakout optimization'' by looking for
391typeahead periodically while updating the screen. If input is found,
392and it is coming from a tty, the current update is postponed until
393refresh or doupdate is called again, allowing faster response to
394commands typed in advance. This function allows specifying a different
395file descriptor for typeahead checking.
396\end{funcdesc}
397
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000398\begin{funcdesc}{unctrl}{ch}
399Returns a string which is a printable representation of the character
400\var{ch}. Control characters are displayed as a caret followed by the
401character, for example as \verb|^C|. Printing characters are left as they
402are.
403\end{funcdesc}
404
405\begin{funcdesc}{ungetch}{ch}
406Push \var{ch} so the next \method{getch()} will return it.
407\strong{Note:} only one \var{ch} can be pushed before \method{getch()}
408is called.
409\end{funcdesc}
410
Andrew M. Kuchlingefc43d42000-06-30 01:05:39 +0000411\begin{funcdesc}{ungetmouse}{id, x, y, z, bstate}
412Push a \constant{KEY_MOUSE} event onto the input queue, associating
413the given state data with it.
414\end{funcdesc}
415
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000416\begin{funcdesc}{use_env}{flag}
417If used, this function should be called before \function{initscr} or
418newterm are called. When \var{flag} is false, the values of
419lines and columns specified in the terminfo database will be
420used, even if environment variables LINES and COLUMNS (used by
421default) are set, or if curses is running in a window (in which
422case default behavior would be to use the window size if LINES
423and COLUMNS are not set).
424\end{funcdesc}
Fred Drakea4070ce1999-06-21 21:13:09 +0000425
426\subsection{Window Objects \label{curses-window-objects}}
427
428Window objects, as returned by \function{initscr()} and
429\function{newwin()} above, have the
430following methods:
431
Fred Drakea4070ce1999-06-21 21:13:09 +0000432\begin{methoddesc}{addch}{\optional{y, x,} ch\optional{, attr}}
433\strong{Note:} A \emph{character} means a C character (i.e., an
434\ASCII{} code), rather then a Python character (a string of length 1).
435(This note is true whenever the documentation mentions a character.)
436
437Paint character \var{ch} at \code{(\var{y}, \var{x})} with attributes
438\var{attr}, overwriting any character previously painter at that
439location. By default, the character position and attributes are the
440current settings for the window object.
441\end{methoddesc}
442
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000443\begin{methoddesc}{addnstr}{\optional{y, x,} str, n\optional{, attr}}
444Paint at most \var{n} characters of the
445string \var{str} at \code{(\var{y}, \var{x})} with attributes
Fred Drake0bccd731999-06-23 17:28:01 +0000446\var{attr}, overwriting anything previously on the display.
Fred Drakea4070ce1999-06-21 21:13:09 +0000447\end{methoddesc}
448
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000449\begin{methoddesc}{addstr}{\optional{y, x,} str\optional{, attr}}
450Paint the string \var{str} at \code{(\var{y}, \var{x})} with attributes
451\var{attr}, overwriting anything previously on the display.
Fred Drakea4070ce1999-06-21 21:13:09 +0000452\end{methoddesc}
453
454\begin{methoddesc}{attroff}{attr}
Fred Drake0bccd731999-06-23 17:28:01 +0000455Turn off attribute \var{attr}.
Fred Drakea4070ce1999-06-21 21:13:09 +0000456\end{methoddesc}
457
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000458\begin{methoddesc}{attron}{attr}
459Turn on attribute \var{attr}.
Fred Drakea4070ce1999-06-21 21:13:09 +0000460\end{methoddesc}
461
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000462\begin{methoddesc}{attrset}{attr}
463Set the attributes to \var{attr}.
Fred Drakea4070ce1999-06-21 21:13:09 +0000464\end{methoddesc}
465
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000466\begin{methoddesc}{bkgd}{ch\optional{, attr}}
467Sets the background property of the window to the character \var{ch},
468with attributes \var{attr}. The change is then applied to every
469character position in that window:
470\begin{itemize}
471\item The attribute of every character in the window is
472 changed to the new background attribute.
473
474\item Wherever the former background character appears,
475it is changed to the new background character.
476\end{itemize}
477
478\end{methoddesc}
479
480\begin{methoddesc}{bkgdset}{ch\optional{, attr}}
481Sets the window's background. A window's background consists of a
482character and any combination of attributes. The attribute part of
483the background is combined (OR'ed) with all non-blank characters that
484are written into the window. Both the character and attribute parts
485of the background are combined with the blank characters. The
486background becomes a property of the character and moves with the
487character through any scrolling and insert/delete line/character
488operations.
Fred Drakea4070ce1999-06-21 21:13:09 +0000489\end{methoddesc}
490
Fred Drake0bccd731999-06-23 17:28:01 +0000491\begin{methoddesc}{border}{\optional{ls\optional{, rs\optional{, ts\optional{,
492 bs\optional{, tl\optional{, tr\optional{,
493 bl\optional{, br}}}}}}}}}
494Draw a border around the edges of the window. Each parameter specifies
495the character to use for a specific part of the border; see the table
496below for more details. The characters must be specified as integers;
497using one-character strings will cause \exception{TypeError} to be
498raised.
499
500\strong{Note:} A \code{0} value for any parameter will cause the
501default character to be used for that parameter. Keyword parameters
502can \emph{not} be used. The defaults are listed in this table:
503
504\begin{tableiii}{l|l|l}{var}{Parameter}{Description}{Default value}
505 \lineiii{ls}{Left side}{\constant{ACS_VLINE}}
506 \lineiii{rs}{Right side}{\constant{ACS_VLINE}}
507 \lineiii{ts}{Top}{\constant{ACS_HLINE}}
508 \lineiii{bs}{Bottom}{\constant{ACS_HLINE}}
509 \lineiii{tl}{Upper-left corner}{\constant{ACS_ULCORNER}}
510 \lineiii{tr}{Upper-right corner}{\constant{ACS_URCORNER}}
511 \lineiii{bl}{Bottom-left corner}{\constant{ACS_BLCORNER}}
512 \lineiii{br}{Bottom-right corner}{\constant{ACS_BRCORNER}}
513\end{tableiii}
Fred Drakea4070ce1999-06-21 21:13:09 +0000514\end{methoddesc}
515
Fred Drake0bccd731999-06-23 17:28:01 +0000516\begin{methoddesc}{box}{\optional{vertch, horch}}
517Similar to \method{border()}, but both \var{ls} and \var{rs} are
518\var{vertch} and both \var{ts} and {bs} are \var{horch}. The default
519corner characters are always used by this function.
Fred Drakea4070ce1999-06-21 21:13:09 +0000520\end{methoddesc}
521
Fred Drakea4070ce1999-06-21 21:13:09 +0000522\begin{methoddesc}{clear}{}
523Like \method{erase()}, but also causes the whole screen to be repainted
524upon next call to \method{refresh()}.
525\end{methoddesc}
526
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000527\begin{methoddesc}{clearok}{yes}
528If \var{yes} is 1, the next call to \method{refresh()}
529will clear the screen completely.
530\end{methoddesc}
531
Fred Drakea4070ce1999-06-21 21:13:09 +0000532\begin{methoddesc}{clrtobot}{}
533Erase from cursor to the end of the screen: all lines below the cursor
534are deleted, and then the equivalent of \method{clrtoeol()} is performed.
535\end{methoddesc}
536
537\begin{methoddesc}{clrtoeol}{}
538Erase from cursor to the end of the line.
539\end{methoddesc}
540
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000541\begin{methoddesc}{cursyncup}{}
542Updates the current cursor position of all the ancestors of the window
543to reflect the current cursor position of the window.
Fred Drakea4070ce1999-06-21 21:13:09 +0000544\end{methoddesc}
545
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000546\begin{methoddesc}{delch}{\optional{x, y}}
547Delete any character at \code{(\var{y}, \var{x})}.
Fred Drakea4070ce1999-06-21 21:13:09 +0000548\end{methoddesc}
549
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000550\begin{methoddesc}{deleteln}{}
551Delete the line under the cursor. All following lines are moved up
552by 1 line.
553\end{methoddesc}
554
555\begin{methoddesc}{derwin}{\optional{nlines, ncols,} begin_y, begin_y}
556An abbreviation for ``derive window'', \method{derwin()} is the same
557as calling \method{subwin()}, except that \var{begin_y} and
558\var{begin_x} are relative to the origin of the window, rather than
559relative to the entire screen. Returns a window object for the
560derived window.
561\end{methoddesc}
562
563\begin{methoddesc}{echochar}{ch\optional{, attr}}
564Add character \var{ch} with attribute \var{attr}, and immediately
565call \method{refresh}.
566\end{methoddesc}
567
Andrew M. Kuchlingefc43d42000-06-30 01:05:39 +0000568\begin{methoddesc}{enclose}{y, x}
569Tests whether the given pair of screen-relative character-cell
570coordinates are enclosed by the given window, returning true or
571false. It is useful for determining what subset of the screen
572windows enclose the location of a mouse event.
573\end{methoddesc}
574
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000575\begin{methoddesc}{erase}{}
576Clear the window.
577\end{methoddesc}
578
579\begin{methoddesc}{getbegyx}{}
580Return a tuple \code{(\var{y}, \var{x})} of co-ordinates of upper-left
581corner.
Fred Drakea4070ce1999-06-21 21:13:09 +0000582\end{methoddesc}
583
584\begin{methoddesc}{getch}{\optional{x, y}}
585Get a character. Note that the integer returned does \emph{not} have to
586be in \ASCII{} range: function keys, keypad keys and so on return numbers
587higher then 256. In no-delay mode, an exception is raised if there is
588no input.
589\end{methoddesc}
590
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000591\begin{methoddesc}{getkey}{\optional{x, y}}
592Get a character, returning a string instead of an integer, as
593\method{getch()} does. Function keys, keypad keys and so on return a
594multibyte string containing the key name. In no-delay mode, an
595exception is raised if there is no input.
596\end{methoddesc}
597
598\begin{methoddesc}{getmaxyx}{}
599Return a tuple \code{(\var{y}, \var{x})} of the height and width of
600the window.
601\end{methoddesc}
602
603\begin{methoddesc}{getparyx}{}
604Returns the beginning coordinates of this window relative to its
605parent window into two integer variables y and x. Returns
606\code{-1,-1} if this window has no parent.
607\end{methoddesc}
608
Fred Drakea4070ce1999-06-21 21:13:09 +0000609\begin{methoddesc}{getstr}{\optional{x, y}}
610Read a string from the user, with primitive line editing capacity.
611\end{methoddesc}
612
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000613\begin{methoddesc}{getyx}{}
614Return a tuple \code{(\var{y}, \var{x})} of current cursor position.
615\end{methoddesc}
616
617\begin{methoddesc}{hline}{\optional{y, x,} ch, n}
618Display a horizontal line starting at \code{(\var{y}, \var{x})} with
619length \var{n} consisting of the character \var{ch}.
620\end{methoddesc}
621
622\begin{methoddesc}{idcok}{flag}
623If \var{flag} is false, curses no longer considers using the hardware
624insert/delete character feature of the terminal; if \var{flag} is
625true, use of character insertion and deletion is enabled. When curses
626is first initialized, use of character insert/delete is enabled by
627default.
628\end{methoddesc}
629
630\begin{methoddesc}{idlok}{yes}
631If called with \var{yes} equal to 1, \module{curses} will try and use
632hardware line editing facilities. Otherwise, line insertion/deletion
633are disabled.
634\end{methoddesc}
635
636\begin{methoddesc}{immedok}{flag}
637If \var{flag} is true, any change in the window image
638automatically causes the window to be refreshed; you no longer
639have to call \method{refresh()} yourself. However, it may
640degrade performance considerably, due to repeated calls to
641wrefresh. This option is disabled by default.
642\end{methoddesc}
643
Fred Drakea4070ce1999-06-21 21:13:09 +0000644\begin{methoddesc}{inch}{\optional{x, y}}
645Return the character at the given position in the window. The bottom
6468 bits are the character proper, and upper bits are the attributes.
647\end{methoddesc}
648
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000649\begin{methoddesc}{insch}{\optional{y, x,} ch\optional{, attr}}
650Paint character \var{ch} at \code{(\var{y}, \var{x})} with attributes
651\var{attr}, moving the line from position \var{x} right by one
652character.
Fred Drakea4070ce1999-06-21 21:13:09 +0000653\end{methoddesc}
654
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000655\begin{methoddesc}{insdelln}{nlines}
656Inserts \var{nlines} lines into the specified window above the current
657line. The \var{nlines} bottom lines are lost. For negative
658\var{nlines}, delete \var{nlines} lines starting with the one under
659the cursor, and move the remaining lines up. The bottom \var{nlines}
660lines are cleared. The current cursor position remains the same.
661\end{methoddesc}
662
663\begin{methoddesc}{insertln}{}
664Insert a blank line under the cursor. All following lines are moved
665down by 1 line.
666\end{methoddesc}
667
668\begin{methoddesc}{insnstr}{\optional{y, x, } str, n \optional{, attr}}
669Insert a character string (as many characters as will fit on the line)
670before the character under the cursor, up to \var{n} characters.
671If \var{n} is zero or negative,
672the entire string is inserted.
673All characters to the right of
674the cursor are shifted right, with the the rightmost characters on the
675line being lost. The cursor position does not change (after moving to
676\var{y}, \var{x}, if specified).
677\end{methoddesc}
678
679\begin{methoddesc}{insstr}{\optional{y, x, } str \optional{, attr}}
680Insert a character string (as many characters as will fit on the line)
681before the character under the cursor. All characters to the right of
682the cursor are shifted right, with the the rightmost characters on the
683line being lost. The cursor position does not change (after moving to
684\var{y}, \var{x}, if specified).
685\end{methoddesc}
686
687\begin{methoddesc}{instr}{\optional{y, x} \optional{, n}}
688Returns a string of characters, extracted from the window starting at
689the current cursor position, or at \var{y}, \var{x} if specified.
690Attributes are stripped from the characters. If \var{n} is specified,
691\method{instr()} returns return a string at most \var{n} characters
692long (exclusive of the trailing NUL).
693\end{methoddesc}
694
695\begin{methoddesc}{is_linetouched}{\var{line}}
696Returns true if the specified line was modified since the last call to
697\method{refresh()}; otherwise returns false. Raises a
698\exception{curses.error} exception if \var{line} is not valid
699for the given window.
700\end{methoddesc}
701
702\begin{methoddesc}{is_wintouched}{}
703Returns true if the specified window was modified since the last call to
704\method{refresh()}; otherwise returns false.
705\end{methoddesc}
706
707\begin{methoddesc}{keypad}{yes}
708If \var{yes} is 1, escape sequences generated by some keys (keypad,
709function keys) will be interpreted by \module{curses}.
710If \var{yes} is 0, escape sequences will be left as is in the input
711stream.
Fred Drakea4070ce1999-06-21 21:13:09 +0000712\end{methoddesc}
713
714\begin{methoddesc}{leaveok}{yes}
715If \var{yes} is 1,
716cursor is left where it is, instead of being at ``cursor position.''
717This reduces cursor movement where possible. If possible it will be made
718invisible.
719
720If \var{yes} is 0, cursor will always be at
721``cursor position'' after an update.
722\end{methoddesc}
723
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000724\begin{methoddesc}{move}{new_y, new_x}
725Move cursor to \code{(\var{new_y}, \var{new_x})}.
Fred Drakea4070ce1999-06-21 21:13:09 +0000726\end{methoddesc}
727
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000728\begin{methoddesc}{mvderwin}{y, x}
729Moves the window inside its parent window. The screen-relative
730parameters of the window are not changed. This routine is used to
731display different parts of the parent window at the same physical
732position on the screen.
733\end{methoddesc}
Fred Drakea4070ce1999-06-21 21:13:09 +0000734
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000735\begin{methoddesc}{mvwin}{new_y, new_x}
736Move the window so its upper-left corner is at \code{(\var{new_y}, \var{new_x})}.
Fred Drakea4070ce1999-06-21 21:13:09 +0000737\end{methoddesc}
738
739\begin{methoddesc}{nodelay}{yes}
740If \var{yes} is 1, \method{getch()} will be non-blocking.
741\end{methoddesc}
742
743\begin{methoddesc}{notimeout}{yes}
744If \var{yes} is 1, escape sequences will not be timed out.
745
746If \var{yes} is 0, after a few milliseconds, an escape sequence will
747not be interpreted, and will be left in the input stream as is.
748\end{methoddesc}
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000749
750\begin{methoddesc}{noutrefresh}{}
751Mark for refresh but wait.
752\end{methoddesc}
753
754\begin{methoddesc}{putwin}{file}
755Writes all data associated with the window into the provided file
756object. This information can be later retrieved using the
757\function{getwin()} function.
758
759\end{methoddesc}
760
761\begin{methoddesc}{redrawln}{beg, num}
762Indicates that the \var{num} screen lines, starting at line \var{beg},
763are corrupted and should be completely redrawn on the next
764\method{refresh()} call.
765\end{methoddesc}
766
767\begin{methoddesc}{redrawwin}{}
768Touches the entire window, causing it to be completely redrawn on the
769next \method{refresh()} call.
770\end{methoddesc}
771
772\begin{methoddesc}{refresh}{ \optional{pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol} }
773Update the display immediately (sync actual screen with previous
774drawing/deleting methods).
775
776The 6 optional arguments can only be specified when the window is a
777pad created with \function{newpad()}. The additional parameters are
778needed to indicate what part of the pad and screen are involved.
779\var{pminrow} and \var{pmincol} specify the upper left-hand corner of the
780rectangle to be displayed in the pad. \var{sminrow}, \var{smincol},
781\var{smaxrow}, and \var{smaxcol} specify the edges of the rectangle to be displayed on the screen. The lower right-hand corner of the
782rectangle to be displayed in the pad is calculated from the screen
783coordinates, since the rectangles must be the same size. Both
784rectangles must be entirely contained within their respective
785structures. Negative values of \var{pminrow}, \var{pmincol},
786\var{sminrow}, or \var{smincol} are treated as if they were zero.
787\end{methoddesc}
788
789\begin{methoddesc}{scroll}{\optional{lines\code{ = 1}}}
790Scroll the screen upward by \var{lines} lines.
791\end{methoddesc}
792
793\begin{methoddesc}{scrollok}{flag}
794Controls what happens when the cursor of a window is moved off the
795 edge of the window or scrolling region, either as a result of a
796 newline action on the bottom line, or typing the last character
797 of the last line. If \var{flag} is false, the cursor is left
798 on the bottom line. If \var{flag} is true, the window is
799 scrolled up one line. Note that in order to get the physical
800 scrolling effect on the terminal, it is also necessary to call
801 \method{idlok()}.
802\end{methoddesc}
803
804\begin{methoddesc}{setscrreg}{top, bottom}
805Set the scrolling region from line \var{top} to line \var{bottom}. All
806scrolling actions will take place in this region.
807\end{methoddesc}
808
809\begin{methoddesc}{standend}{}
810Turn off all attributes.
811\end{methoddesc}
812
813\begin{methoddesc}{standout}{}
814Turn on attribute \var{A_STANDOUT}.
815\end{methoddesc}
816
817\begin{methoddesc}{subpad}{\optional{nlines, ncols,} begin_y, begin_y}
818Return a sub-window, whose upper-left corner is at
819\code{(\var{begin_y}, \var{begin_x})}, and whose width/height is
820\var{ncols}/\var{nlines}.
821\end{methoddesc}
822
823\begin{methoddesc}{subwin}{\optional{nlines, ncols,} begin_y, begin_y}
824Return a sub-window, whose upper-left corner is at
825\code{(\var{begin_y}, \var{begin_x})}, and whose width/height is
826\var{ncols}/\var{nlines}.
827
828By default, the sub-window will extend from the
829specified position to the lower right corner of the window.
830\end{methoddesc}
831
832\begin{methoddesc}{syncdown}{}
833Touches each location in the window that has been touched in any of
834its ancestor windows. This routine is called by \method{refresh()},
835so it should almost never be necessary to call it manually.
836\end{methoddesc}
837
838\begin{methoddesc}{syncok}{flag}
839If called with \var{flag} set to true, then \method{syncup()} is
840called automatically whenever there is a change in the window.
841\end{methoddesc}
842
843\begin{methoddesc}{syncup}{}
844Touches all locations in ancestors of the window that have been changed in
845the window.
846\end{methoddesc}
847
Andrew M. Kuchlingd24ff442000-06-21 01:42:51 +0000848\begin{methoddesc}{timeout}{delay}
Thomas Woutersf8316632000-07-16 19:01:10 +0000849Sets blocking or non-blocking read behavior for the window. If
Andrew M. Kuchlingd24ff442000-06-21 01:42:51 +0000850\var{delay} is negative, blocking read is used, which will wait
851indefinitely for input). If \var{delay} is zero, then non-blocking
852read is used, and -1 will be returned by \method{getch()} if no input
853is waiting. If \var{delay} is positive, then \method{getch()} will
854block for \var{delay} milliseconds, and return -1 if there is still no
855input at the end of that time.
856\end{methoddesc}
857
Andrew M. Kuchlingf1dc5fa2000-05-23 16:46:04 +0000858\begin{methoddesc}{touchline}{start, count}
859Pretend \var{count} lines have been changed, starting with line
860\var{start}.
861\end{methoddesc}
862
863\begin{methoddesc}{touchwin}{}
864Pretend the whole window has been changed, for purposes of drawing
865optimizations.
866\end{methoddesc}
867
868\begin{methoddesc}{untouchwin}{}
869Marks all lines in the window as unchanged since the last call to
870\method{refresh()}.
871\end{methoddesc}
872
873\begin{methoddesc}{vline}{\optional{y, x,} ch, n}
874Display a vertical line starting at \code{(\var{y}, \var{x})} with
875length \var{n} consisting of the character \var{ch}.
876\end{methoddesc}
877
878\subsection{Constants}
879
880The \module{curses} module defines the following data members:
881
882\begin{datadesc}{version}
883A string representing the current version of the module.
884Also available as \constant{__version__}.
885\end{datadesc}
886
887
888\begin{tableii}{c|l}{code}{Attribute}{Meaning}
889 \lineii{A_ALTCHARSET}{Alternate character set mode.}
890 \lineii{A_BLINK}{Blink mode.}
891 \lineii{A_BOLD}{Bold mode.}
892 \lineii{A_DIM}{Dim mode.}
893 \lineii{A_NORMAL}{Normal attribute.}
894 \lineii{A_STANDOUT}{Standout mode.}
895 \lineii{A_UNDERLINE}{Underline mode.}
896\end{tableii}
897
898Keys are referred to by integer constants with names starting with
899\code{KEY_}. The exact names available are system dependent.
900
901% XXX this table is far too large!
902% XXX should this table be alphabetized?
903
904\begin{tableii}{c|l}{code}{Key constant}{Key}
905 \lineii{KEY_MIN}{Minimum key value}
906 \lineii{KEY_BREAK}{ Break key (unreliable) }
907 \lineii{KEY_DOWN}{ Down-arrow }
908 \lineii{KEY_UP}{ Up-arrow }
909 \lineii{KEY_LEFT}{ Left-arrow }
910 \lineii{KEY_RIGHT}{ Right-arrow }
911 \lineii{KEY_HOME}{ Home key (upward+left arrow) }
912 \lineii{KEY_BACKSPACE}{ Backspace (unreliable) }
913 \lineii{KEY_F0}{ Function keys. Up to 64 function keys are supported. }
914 \lineii{KEY_F\var{n}}{ Value of function key \var{n} }
915 \lineii{KEY_DL}{ Delete line }
916 \lineii{KEY_IL}{ Insert line }
917 \lineii{KEY_DC}{ Delete character }
918 \lineii{KEY_IC}{ Insert char or enter insert mode }
919 \lineii{KEY_EIC}{ Exit insert char mode }
920 \lineii{KEY_CLEAR}{ Clear screen }
921 \lineii{KEY_EOS}{ Clear to end of screen }
922 \lineii{KEY_EOL}{ Clear to end of line }
923 \lineii{KEY_SF}{ Scroll 1 line forward }
924 \lineii{KEY_SR}{ Scroll 1 line backward (reverse) }
925 \lineii{KEY_NPAGE}{ Next page }
926 \lineii{KEY_PPAGE}{ Previous page }
927 \lineii{KEY_STAB}{ Set tab }
928 \lineii{KEY_CTAB}{ Clear tab }
929 \lineii{KEY_CATAB}{ Clear all tabs }
930 \lineii{KEY_ENTER}{ Enter or send (unreliable) }
931 \lineii{KEY_SRESET}{ Soft (partial) reset (unreliable) }
932 \lineii{KEY_RESET}{ Reset or hard reset (unreliable) }
933 \lineii{KEY_PRINT}{ Print }
934 \lineii{KEY_LL}{ Home down or bottom (lower left) }
935 \lineii{KEY_A1}{ Upper left of keypad }
936 \lineii{KEY_A3}{ Upper right of keypad }
937 \lineii{KEY_B2}{ Center of keypad }
938 \lineii{KEY_C1}{ Lower left of keypad }
939 \lineii{KEY_C3}{ Lower right of keypad }
940 \lineii{KEY_BTAB}{ Back tab }
941 \lineii{KEY_BEG}{ Beg (beginning) }
942 \lineii{KEY_CANCEL}{ Cancel }
943 \lineii{KEY_CLOSE}{ Close }
944 \lineii{KEY_COMMAND}{ Cmd (command) }
945 \lineii{KEY_COPY}{ Copy }
946 \lineii{KEY_CREATE}{ Create }
947 \lineii{KEY_END}{ End }
948 \lineii{KEY_EXIT}{ Exit }
949 \lineii{KEY_FIND}{ Find }
950 \lineii{KEY_HELP}{ Help }
951 \lineii{KEY_MARK}{ Mark }
952 \lineii{KEY_MESSAGE}{ Message }
953 \lineii{KEY_MOVE}{ Move }
954 \lineii{KEY_NEXT}{ Next }
955 \lineii{KEY_OPEN}{ Open }
956 \lineii{KEY_OPTIONS}{ Options }
957 \lineii{KEY_PREVIOUS}{ Prev (previous) }
958 \lineii{KEY_REDO}{ Redo }
959 \lineii{KEY_REFERENCE}{ Ref (reference) }
960 \lineii{KEY_REFRESH}{ Refresh }
961 \lineii{KEY_REPLACE}{ Replace }
962 \lineii{KEY_RESTART}{ Restart }
963 \lineii{KEY_RESUME}{ Resume }
964 \lineii{KEY_SAVE}{ Save }
965 \lineii{KEY_SBEG}{ Shifted Beg (beginning) }
966 \lineii{KEY_SCANCEL}{ Shifted Cancel }
967 \lineii{KEY_SCOMMAND}{ Shifted Command }
968 \lineii{KEY_SCOPY}{ Shifted Copy }
969 \lineii{KEY_SCREATE}{ Shifted Create }
970 \lineii{KEY_SDC}{ Shifted Delete char }
971 \lineii{KEY_SDL}{ Shifted Delete line }
972 \lineii{KEY_SELECT}{ Select }
973 \lineii{KEY_SEND}{ Shifted End }
974 \lineii{KEY_SEOL}{ Shifted Clear line }
975 \lineii{KEY_SEXIT}{ Shifted Dxit }
976 \lineii{KEY_SFIND}{ Shifted Find }
977 \lineii{KEY_SHELP}{ Shifted Help }
978 \lineii{KEY_SHOME}{ Shifted Home }
979 \lineii{KEY_SIC}{ Shifted Input }
980 \lineii{KEY_SLEFT}{ Shifted Left arrow }
981 \lineii{KEY_SMESSAGE}{ Shifted Message }
982 \lineii{KEY_SMOVE}{ Shifted Move }
983 \lineii{KEY_SNEXT}{ Shifted Next }
984 \lineii{KEY_SOPTIONS}{ Shifted Options }
985 \lineii{KEY_SPREVIOUS}{ Shifted Prev }
986 \lineii{KEY_SPRINT}{ Shifted Print }
987 \lineii{KEY_SREDO}{ Shifted Redo }
988 \lineii{KEY_SREPLACE}{ Shifted Replace }
989 \lineii{KEY_SRIGHT}{ Shifted Right arrow }
990 \lineii{KEY_SRSUME}{ Shifted Resume }
991 \lineii{KEY_SSAVE}{ Shifted Save }
992 \lineii{KEY_SSUSPEND}{ Shifted Suspend }
993 \lineii{KEY_SUNDO}{ Shifted Undo }
994 \lineii{KEY_SUSPEND}{ Suspend }
995 \lineii{KEY_UNDO}{ Undo }
996 \lineii{KEY_MOUSE}{ Mouse event has occurred }
997 \lineii{KEY_RESIZE}{ Terminal resize event }
998 \lineii{KEY_MAX}{Maximum key value}
999\end{tableii}
1000
1001The following table lists characters from the alternate character set.
1002\strong{Note:} These are available only after \function{initscr()} has
1003been called.
1004
1005\begin{tableii}{c|l}{code}{ACS code}{Meaning}
1006 \lineii{ACS_BBSS}{}
1007 \lineii{ACS_BLOCK}{}
1008 \lineii{ACS_BOARD}{}
1009 \lineii{ACS_BSBS}{}
1010 \lineii{ACS_BSSB}{}
1011 \lineii{ACS_BSSS}{}
1012 \lineii{ACS_BTEE}{}
1013 \lineii{ACS_BULLET}{}
1014 \lineii{ACS_CKBOARD}{}
1015 \lineii{ACS_DARROW}{}
1016 \lineii{ACS_DEGREE}{}
1017 \lineii{ACS_DIAMOND}{}
1018 \lineii{ACS_GEQUAL}{ (Not available with SGI curses)}
1019 \lineii{ACS_HLINE}{}
1020 \lineii{ACS_LANTERN}{}
1021 \lineii{ACS_LARROW}{}
1022 \lineii{ACS_LEQUAL}{ (Not available with SGI curses)}
1023 \lineii{ACS_LLCORNER}{}
1024 \lineii{ACS_LRCORNER}{}
1025 \lineii{ACS_LTEE}{}
1026 \lineii{ACS_NEQUAL}{ (Not available with SGI curses)}
1027 \lineii{ACS_PI}{ (Not available with SGI curses)}
1028 \lineii{ACS_PLMINUS}{}
1029 \lineii{ACS_PLUS}{}
1030 \lineii{ACS_RARROW}{}
1031 \lineii{ACS_RTEE}{}
1032 \lineii{ACS_S1}{}
1033 \lineii{ACS_S3}{ (Not available with SGI curses)}
1034 \lineii{ACS_S9}{}
1035 \lineii{ACS_SBBS}{}
1036 \lineii{ACS_SBSB}{}
1037 \lineii{ACS_SBSS}{}
1038 \lineii{ACS_SSBB}{}
1039 \lineii{ACS_SSBS}{}
1040 \lineii{ACS_SSSB}{}
1041 \lineii{ACS_SSSS}{}
1042 \lineii{ACS_STERLING}{ (Not available with SGI curses)}
1043 \lineii{ACS_TTEE}{}
1044 \lineii{ACS_UARROW}{}
1045 \lineii{ACS_ULCORNER}{}
1046 \lineii{ACS_URCORNER}{}
1047 \lineii{ACS_VLINE}{}
1048\end{tableii}
1049
1050The following table lists the predefined colors:
1051
1052\begin{tableii}{c|l}{code}{Constant}{Color}
1053 \lineii{COLOR_BLACK}{Black}
1054 \lineii{COLOR_BLUE}{Blue}
1055 \lineii{COLOR_CYAN}{Cyan (light greenish blue)}
1056 \lineii{COLOR_GREEN}{Green}
1057 \lineii{COLOR_MAGENTA}{Magenta (purplish red)}
1058 \lineii{COLOR_RED}{Red}
1059 \lineii{COLOR_WHITE}{White}
1060 \lineii{COLOR_YELLOW}{Yellow}
1061\end{tableii}
1062