Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e412e7a3
Commit
e412e7a3
authored
Dec 21, 2000
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix lots of small markup nits.
Wrapped some long lines.
parent
23382f50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
54 deletions
+64
-54
Doc/lib/libcurses.tex
Doc/lib/libcurses.tex
+64
-54
No files found.
Doc/lib/libcurses.tex
View file @
e412e7a3
...
@@ -79,17 +79,18 @@ then \function{cbreak()} leaves the terminal in cbreak mode.
...
@@ -79,17 +79,18 @@ then \function{cbreak()} leaves the terminal in cbreak mode.
\begin{funcdesc}
{
color
_
content
}{
color
_
number
}
\begin{funcdesc}
{
color
_
content
}{
color
_
number
}
Returns the intensity of the red, green, and blue (RGB) components in
Returns the intensity of the red, green, and blue (RGB) components in
the color
\var
{
color
_
number
}
, which must be between
0 and COLORS. A
the color
\var
{
color
_
number
}
, which must be between
\code
{
0
}
and
3-tuple is returned, containing the R,G,B values for the given color,
\constant
{
COLORS
}
. A 3-tuple is returned, containing the R,G,B values
which will be between 0 (no component) and 1000 (maximum amount of
for the given color, which will be between
\code
{
0
}
(no component) and
component).
\code
{
1000
}
(maximum amount of
component).
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
color
_
pair
}{
color
_
number
}
\begin{funcdesc}
{
color
_
pair
}{
color
_
number
}
Returns the attribute value for displaying text in the specified
Returns the attribute value for displaying text in the specified
color. This attribute value can be combined with
color. This attribute value can be combined with
\constant
{
A
_
STANDOUT
}
,
\constant
{
A
_
REVERSE
}
, and the other
\constant
{
A
_
STANDOUT
}
,
\constant
{
A
_
REVERSE
}
, and the other
\constant
{
A
_
*
}
attributes.
\function
{
pair
_
number()
}
is the counterpart to this function.
\constant
{
A
_
*
}
attributes.
\function
{
pair
_
number()
}
is the
counterpart to this function.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
curs
_
set
}{
visibility
}
\begin{funcdesc}
{
curs
_
set
}{
visibility
}
...
@@ -231,30 +232,32 @@ Used for half-delay mode, which is similar to cbreak mode in that
...
@@ -231,30 +232,32 @@ Used for half-delay mode, which is similar to cbreak mode in that
characters typed by the user are immediately available to the program.
characters typed by the user are immediately available to the program.
However, after blocking for
\var
{
tenths
}
tenths of seconds, an
However, after blocking for
\var
{
tenths
}
tenths of seconds, an
exception is raised if nothing has been typed. The value of
exception is raised if nothing has been typed. The value of
\var
{
tenths
}
must be a number between 1 and 255. Use
\function
{
nocbreak()
}
to
\var
{
tenths
}
must be a number between 1 and 255. Use
leave half-delay mode.
\function
{
nocbreak()
}
to
leave half-delay mode.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
init
_
color
}{
color
_
number, r, g, b
}
\begin{funcdesc}
{
init
_
color
}{
color
_
number, r, g, b
}
Changes the definition of a color, taking the number of the color to
Changes the definition of a color, taking the number of the color to
be changed followed by three RGB values (for the amounts of red,
be changed followed by three RGB values (for the amounts of red,
green, and blue components). The value of
\var
{
color
_
number
}
must be
green, and blue components). The value of
\var
{
color
_
number
}
must be
between 0 and COLORS. Each of
\var
{
r
}
,
\var
{
g
}
,
\var
{
b
}
, must be a
between
\code
{
0
}
and
\constant
{
COLORS
}
. Each of
\var
{
r
}
,
\var
{
g
}
,
value between 0 and 1000. When
\function
{
init
_
color()
}
is used, all
\var
{
b
}
, must be a value between
\code
{
0
}
and
\code
{
1000
}
. When
occurrences of that color on the screen immediately change to the new
\function
{
init
_
color()
}
is used, all occurrences of that color on the
definition. This function is a no-op on most terminals; it is active
screen immediately change to the new definition. This function is a
only if
\function
{
can
_
change
_
color()
}
returns 1.
no-op on most terminals; it is active only if
\function
{
can
_
change
_
color()
}
returns
\code
{
1
}
.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
init
_
pair
}{
pair
_
number, fg, bg
}
\begin{funcdesc}
{
init
_
pair
}{
pair
_
number, fg, bg
}
Changes the definition of a color-pair. It takes three arguments: the
Changes the definition of a color-pair. It takes three arguments: the
number of the color-pair to be changed, the foreground color number,
number of the color-pair to be changed, the foreground color number,
and the background color number. The value of
\var
{
pair
_
number
}
must
and the background color number. The value of
\var
{
pair
_
number
}
must
be between 1 and COLOR
_
PAIRS-1 (the 0 color pair is wired to white on
be between
\code
{
1
}
and
\code
{
COLOR
_
PAIRS - 1
}
(the
\code
{
0
}
color
black and cannot be changed). The value of
\var
{
fg
}
and
\var
{
bg
}
pair is wired to white on black and cannot be changed). The value of
arguments must be between 0 and COLORS. If the color-pair was
\var
{
fg
}
and
\var
{
bg
}
arguments must be between
\code
{
0
}
and
previously initialized, the screen is refreshed and all occurrences of
\constant
{
COLORS
}
. If the color-pair was previously initialized, the
that color-pair are changed to the new definition.
screen is refreshed and all occurrences of that color-pair are changed
to the new definition.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
initscr
}{}
\begin{funcdesc}
{
initscr
}{}
...
@@ -429,8 +432,9 @@ If \var{y} and \var{x} are both -1, then leaveok is set.
...
@@ -429,8 +432,9 @@ If \var{y} and \var{x} are both -1, then leaveok is set.
\begin{funcdesc}
{
setupterm
}{
\optional
{
termstr, fd
}}
\begin{funcdesc}
{
setupterm
}{
\optional
{
termstr, fd
}}
Initializes the terminal.
\var
{
termstr
}
is a string giving the
Initializes the terminal.
\var
{
termstr
}
is a string giving the
terminal name; if omitted, the value of the TERM environment variable
terminal name; if omitted, the value of the TERM environment variable
will be used.
\var
{
fd
}
is the file descriptor to which any initialization sequences will be sent; if not supplied, the file descriptor for
will be used.
\var
{
fd
}
is the file descriptor to which any
\code
{
sys.stdout
}
will be used.
initialization sequences will be sent; if not supplied, the file
descriptor for
\code
{
sys.stdout
}
will be used.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
start
_
color
}{}
\begin{funcdesc}
{
start
_
color
}{}
...
@@ -440,10 +444,11 @@ practice to call this routine right after \function{initscr()}.
...
@@ -440,10 +444,11 @@ practice to call this routine right after \function{initscr()}.
\function
{
start
_
color()
}
initializes eight basic colors (black, red,
\function
{
start
_
color()
}
initializes eight basic colors (black, red,
green, yellow, blue, magenta, cyan, and white), and two global
green, yellow, blue, magenta, cyan, and white), and two global
variables in the
\module
{
curses
}
module, COLORS and COLOR
_
PAIRS,
variables in the
\module
{
curses
}
module,
\constant
{
COLORS
}
and
containing the maximum number of colors and color-pairs the terminal
\constant
{
COLOR
_
PAIRS
}
, containing the maximum number of colors and
can support. It also restores the colors on the terminal to the
color-pairs the terminal can support. It also restores the colors on
values they had when the terminal was just turned on.
the terminal to the values they had when the terminal was just turned
on.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
termattrs
}{}
\begin{funcdesc}
{
termattrs
}{}
...
@@ -459,16 +464,16 @@ characters.
...
@@ -459,16 +464,16 @@ characters.
\begin{funcdesc}
{
tigetflag
}{
capname
}
\begin{funcdesc}
{
tigetflag
}{
capname
}
Returns the value of the Boolean capability corresponding to the
Returns the value of the Boolean capability corresponding to the
terminfo capability name
\var
{
capname
}
. The value
-1 is returned if
terminfo capability name
\var
{
capname
}
. The value
\code
{
-1
}
is
\var
{
capname
}
is not a Boolean capability, or 0 if it is canceled or
returned if
\var
{
capname
}
is not a Boolean capability, or
\code
{
0
}
if
absent from the terminal description.
it is canceled or
absent from the terminal description.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
tigetnum
}{
capname
}
\begin{funcdesc}
{
tigetnum
}{
capname
}
Returns the value of the numeric capability corresponding to the
Returns the value of the numeric capability corresponding to the
terminfo capability name
\var
{
capname
}
. The value
-2 is returned if
terminfo capability name
\var
{
capname
}
. The value
\code
{
-2
}
is
\var
{
capname
}
is not a numeric capability, or -1 if it is canceled or absent
returned if
\var
{
capname
}
is not a numeric capability, or
\code
{
-1
}
if
from the terminal description.
it is canceled or absent
from the terminal description.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
tigetstr
}{
capname
}
\begin{funcdesc}
{
tigetstr
}{
capname
}
...
@@ -481,13 +486,14 @@ from the terminal description.
...
@@ -481,13 +486,14 @@ from the terminal description.
\begin{funcdesc}
{
tparm
}{
str
\optional
{
,...
}}
\begin{funcdesc}
{
tparm
}{
str
\optional
{
,...
}}
Instantiates the string
\var
{
str
}
with the supplied parameters, where
Instantiates the string
\var
{
str
}
with the supplied parameters, where
\var
{
str
}
should be a parameterized string obtained from the terminfo
\var
{
str
}
should be a parameterized string obtained from the terminfo
database. E.g.
\code
{
tparm(tigetstr("cup"),
5,
3)
}
could result in
database. E.g.
\code
{
tparm(tigetstr("cup"),
5,
3)
}
could result in
\code
{
"
\e
{}
033[6;4H"
}
, the exact result depending on terminal type.
\code
{
'
\e
{}
033[6;4H'
}
, the exact result depending on terminal type.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
typeahead
}{
fd
}
\begin{funcdesc}
{
typeahead
}{
fd
}
Specifies that the file descriptor
\var
{
fd
}
be used for typeahead
Specifies that the file descriptor
\var
{
fd
}
be used for typeahead
checking. If
\var
{
fd
}
is -1, then no typeahead checking is done.
checking. If
\var
{
fd
}
is
\code
{
-1
}
, then no typeahead checking is
done.
The curses library does ``line-breakout optimization'' by looking for
The curses library does ``line-breakout optimization'' by looking for
typeahead periodically while updating the screen. If input is found,
typeahead periodically while updating the screen. If input is found,
...
@@ -516,13 +522,13 @@ the given state data with it.
...
@@ -516,13 +522,13 @@ the given state data with it.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
use
_
env
}{
flag
}
\begin{funcdesc}
{
use
_
env
}{
flag
}
If used, this function should be called before
\function
{
initscr
}
or
If used, this function should be called before
\function
{
initscr
()
}
or
newterm are called. When
\var
{
flag
}
is false, the values of
newterm are called. When
\var
{
flag
}
is false, the values of
lines and columns specified in the terminfo database will be
lines and columns specified in the terminfo database will be
used, even if environment variables
LINES and COLUMNS (used by
used, even if environment variables
\envvar
{
LINES
}
and
default) are set, or if curses is running in a window (in which
\envvar
{
COLUMNS
}
(used by default) are set, or if curses is running in
case default behavior would be to use the window size if LINES
a window (in which case default behavior would be to use the window
and COLUMNS
are not set).
size if
\envvar
{
LINES
}
and
\envvar
{
COLUMNS
}
are not set).
\end{funcdesc}
\end{funcdesc}
\subsection
{
Window Objects
\label
{
curses-window-objects
}}
\subsection
{
Window Objects
\label
{
curses-window-objects
}}
...
@@ -669,7 +675,7 @@ derived window.
...
@@ -669,7 +675,7 @@ derived window.
\begin{methoddesc}
{
echochar
}{
ch
\optional
{
, attr
}}
\begin{methoddesc}
{
echochar
}{
ch
\optional
{
, attr
}}
Add character
\var
{
ch
}
with attribute
\var
{
attr
}
, and immediately
Add character
\var
{
ch
}
with attribute
\var
{
attr
}
, and immediately
call
\method
{
refresh
}
on the window.
call
\method
{
refresh
()
}
on the window.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
{
enclose
}{
y, x
}
\begin{methoddesc}
{
enclose
}{
y, x
}
...
@@ -691,7 +697,7 @@ corner.
...
@@ -691,7 +697,7 @@ corner.
\begin{methoddesc}
{
getch
}{
\optional
{
x, y
}}
\begin{methoddesc}
{
getch
}{
\optional
{
x, y
}}
Get a character. Note that the integer returned does
\emph
{
not
}
have to
Get a character. Note that the integer returned does
\emph
{
not
}
have to
be in
\ASCII
{}
range: function keys, keypad keys and so on return numbers
be in
\ASCII
{}
range: function keys, keypad keys and so on return numbers
higher th
e
n 256. In no-delay mode, an exception is raised if there is
higher th
a
n 256. In no-delay mode, an exception is raised if there is
no input.
no input.
\end{methoddesc}
\end{methoddesc}
...
@@ -840,18 +846,19 @@ position on the screen.
...
@@ -840,18 +846,19 @@ position on the screen.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
{
mvwin
}{
new
_
y, new
_
x
}
\begin{methoddesc}
{
mvwin
}{
new
_
y, new
_
x
}
Move the window so its upper-left corner is at
\code
{
(
\var
{
new
_
y
}
,
\var
{
new
_
x
}
)
}
.
Move the window so its upper-left corner is at
\code
{
(
\var
{
new
_
y
}
,
\var
{
new
_
x
}
)
}
.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
{
nodelay
}{
yes
}
\begin{methoddesc}
{
nodelay
}{
yes
}
If
\var
{
yes
}
is
1
,
\method
{
getch()
}
will be non-blocking.
If
\var
{
yes
}
is
\code
{
1
}
,
\method
{
getch()
}
will be non-blocking.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
{
notimeout
}{
yes
}
\begin{methoddesc}
{
notimeout
}{
yes
}
If
\var
{
yes
}
is
1
, escape sequences will not be timed out.
If
\var
{
yes
}
is
\code
{
1
}
, escape sequences will not be timed out.
If
\var
{
yes
}
is
0, after a few milliseconds, an escape sequence will
If
\var
{
yes
}
is
\code
{
0
}
, after a few milliseconds, an escape sequence
not be interpreted, and will be left in the input stream as is.
will
not be interpreted, and will be left in the input stream as is.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
{
noutrefresh
}{}
\begin{methoddesc}
{
noutrefresh
}{}
...
@@ -861,27 +868,27 @@ an update of the physical screen.
...
@@ -861,27 +868,27 @@ an update of the physical screen.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
{
overlay
}{
destwin
\optional
{
, sminrow, smincol,
\begin{methoddesc}
{
overlay
}{
destwin
\optional
{
, sminrow, smincol,
dminrow, dmincol, dmaxrow, dmaxcol
}}
dminrow, dmincol, dmaxrow, dmaxcol
}}
Overlay the window on top of
\var
{
destwin
}
. The windows need not be
Overlay the window on top of
\var
{
destwin
}
. The windows need not be
the same size, only the overlapping region is copied. This copy is
the same size, only the overlapping region is copied. This copy is
non-destructive, which means that the current background character
non-destructive, which means that the current background character
does not overwrite the old contents of
\var
{
destwin
}
.
does not overwrite the old contents of
\var
{
destwin
}
.
To get fine-grained control over the copied region, the second form
To get fine-grained control over the copied region, the second form
of
\method
{
overlay
}
can be used.
\var
{
sminrow
}
and
\var
{
smincol
}
are
of
\method
{
overlay
()
}
can be used.
\var
{
sminrow
}
and
\var
{
smincol
}
are
the upper-left coordinates of the source window, and the other variables
the upper-left coordinates of the source window, and the other variables
mark a rectangle in the destination window.
mark a rectangle in the destination window.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
{
overwrite
}{
destwin
\optional
{
, sminrow, smincol,
\begin{methoddesc}
{
overwrite
}{
destwin
\optional
{
, sminrow, smincol,
dminrow, dmincol, dmaxrow, dmaxcol
}}
dminrow, dmincol, dmaxrow, dmaxcol
}}
Overwrite the window on top of
\var
{
destwin
}
. The windows need not be
Overwrite the window on top of
\var
{
destwin
}
. The windows need not be
the same size, in which case only the overlapping region is
copied. This copy is
the same size, in which case only the overlapping region is
destructive, which means that the current background character
copied. This copy is destructive, which means that the current
overwrites the old contents of
\var
{
destwin
}
.
background character
overwrites the old contents of
\var
{
destwin
}
.
To get fine-grained control over the copied region, the second form
To get fine-grained control over the copied region, the second form
of
\method
{
overwrite
}
can be used.
\var
{
sminrow
}
and
\var
{
smincol
}
are
of
\method
{
overwrite
()
}
can be used.
\var
{
sminrow
}
and
\var
{
smincol
}
are
the upper-left coordinates of the source window, the other variables
the upper-left coordinates of the source window, the other variables
mark a rectangle in the destination window.
mark a rectangle in the destination window.
\end{methoddesc}
\end{methoddesc}
...
@@ -904,7 +911,8 @@ Touches the entire window, causing it to be completely redrawn on the
...
@@ -904,7 +911,8 @@ Touches the entire window, causing it to be completely redrawn on the
next
\method
{
refresh()
}
call.
next
\method
{
refresh()
}
call.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
{
refresh
}{
\optional
{
pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol
}
}
\begin{methoddesc}
{
refresh
}{
\optional
{
pminrow, pmincol, sminrow,
smincol, smaxrow, smaxcol
}}
Update the display immediately (sync actual screen with previous
Update the display immediately (sync actual screen with previous
drawing/deleting methods).
drawing/deleting methods).
...
@@ -913,7 +921,8 @@ pad created with \function{newpad()}. The additional parameters are
...
@@ -913,7 +921,8 @@ pad created with \function{newpad()}. The additional parameters are
needed to indicate what part of the pad and screen are involved.
needed to indicate what part of the pad and screen are involved.
\var
{
pminrow
}
and
\var
{
pmincol
}
specify the upper left-hand corner of the
\var
{
pminrow
}
and
\var
{
pmincol
}
specify the upper left-hand corner of the
rectangle to be displayed in the pad.
\var
{
sminrow
}
,
\var
{
smincol
}
,
rectangle to be displayed in the pad.
\var
{
sminrow
}
,
\var
{
smincol
}
,
\var
{
smaxrow
}
, and
\var
{
smaxcol
}
specify the edges of the rectangle to be displayed on the screen. The lower right-hand corner of the
\var
{
smaxrow
}
, and
\var
{
smaxcol
}
specify the edges of the rectangle to
be displayed on the screen. The lower right-hand corner of the
rectangle to be displayed in the pad is calculated from the screen
rectangle to be displayed in the pad is calculated from the screen
coordinates, since the rectangles must be the same size. Both
coordinates, since the rectangles must be the same size. Both
rectangles must be entirely contained within their respective
rectangles must be entirely contained within their respective
...
@@ -1283,7 +1292,8 @@ keystrokes:
...
@@ -1283,7 +1292,8 @@ keystrokes:
\lineii
{
Ctrl-A
}{
Go to left edge of window.
}
\lineii
{
Ctrl-A
}{
Go to left edge of window.
}
\lineii
{
Ctrl-B
}{
Cursor left, wrapping to previous line if appropriate.
}
\lineii
{
Ctrl-B
}{
Cursor left, wrapping to previous line if appropriate.
}
\lineii
{
Ctrl-D
}{
Delete character under cursor.
}
\lineii
{
Ctrl-D
}{
Delete character under cursor.
}
\lineii
{
Ctrl-E
}{
Go to right edge (stripspaces off) or end of line (stripspaces on).
}
\lineii
{
Ctrl-E
}{
Go to right edge (stripspaces off) or end of line
(stripspaces on).
}
\lineii
{
Ctrl-F
}{
Cursor right, wrapping to next line when appropriate.
}
\lineii
{
Ctrl-F
}{
Cursor right, wrapping to next line when appropriate.
}
\lineii
{
Ctrl-G
}{
Terminate, returning the window contents.
}
\lineii
{
Ctrl-G
}{
Terminate, returning the window contents.
}
\lineii
{
Ctrl-H
}{
Delete character backward.
}
\lineii
{
Ctrl-H
}{
Delete character backward.
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment