mirror of
https://github.com/python/cpython.git
synced 2025-07-23 19:25:40 +00:00
Updates from Moshe, again edited by me. Describe the parameters to
border() using a table instead of text for ease of comprehension.
This commit is contained in:
parent
92f3f41424
commit
0bccd73be0
1 changed files with 48 additions and 25 deletions
|
@ -82,6 +82,10 @@ The module \module{curses} defines the following exception:
|
||||||
Curses function returned an error status.
|
Curses function returned an error status.
|
||||||
\end{excdesc}
|
\end{excdesc}
|
||||||
|
|
||||||
|
\strong{Note:} Whenever \var{x} or \var{y} arguments to a function
|
||||||
|
or a method are optional, they default to the current cursor location.
|
||||||
|
Whenever \var{attr} is optional, it defaults to \constant{A_NORMAL}.
|
||||||
|
|
||||||
The module \module{curses} defines the following functions:
|
The module \module{curses} defines the following functions:
|
||||||
|
|
||||||
\begin{funcdesc}{initscr}{}
|
\begin{funcdesc}{initscr}{}
|
||||||
|
@ -104,7 +108,9 @@ Update the screen.
|
||||||
\begin{funcdesc}{newwin}{\optional{nlines, ncols,} begin_y, begin_x}
|
\begin{funcdesc}{newwin}{\optional{nlines, ncols,} begin_y, begin_x}
|
||||||
Return a new window, whose left-upper corner is at
|
Return a new window, whose left-upper corner is at
|
||||||
\code{(\var{begin_y}, \var{begin_x})}, and whose height/width is
|
\code{(\var{begin_y}, \var{begin_x})}, and whose height/width is
|
||||||
\var{nlines}/\var{ncols}. By default, the window will extend from the
|
\var{nlines}/\var{ncols}.
|
||||||
|
|
||||||
|
By default, the window will extend from the
|
||||||
specified position to the lower right corner of the screen.
|
specified position to the lower right corner of the screen.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
|
@ -176,8 +182,8 @@ Window objects, as returned by \function{initscr()} and
|
||||||
following methods:
|
following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{refresh}{}
|
\begin{methoddesc}{refresh}{}
|
||||||
Do refresh (sync actual screen with previous drawing/deleting
|
Update the display immediately (sync actual screen with previous
|
||||||
methods.)
|
drawing/deleting methods).
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{nooutrefresh}{}
|
\begin{methoddesc}{nooutrefresh}{}
|
||||||
|
@ -185,18 +191,20 @@ Mark for refresh but wait.
|
||||||
\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{(new_y, 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}{move}{new_y, new_x}
|
\begin{methoddesc}{move}{new_y, new_x}
|
||||||
Move cursor to \code{(\var{new_y}, \var{new_x})}.
|
Move cursor to \code{(\var{new_y}, \var{new_x})}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{subwin}{nlines=HEIGTH-begin_y, ncols=WIDTH-begin_x,
|
\begin{methoddesc}{subwin}{\optional{nlines, ncols,} begin_y, begin_y}
|
||||||
begin_y, begin_y}
|
|
||||||
Return a sub-window, whose upper-left corner is at
|
Return a sub-window, whose upper-left corner is at
|
||||||
\code{(\var{begin_y}, \var{begin_x})}, and whose width/height is
|
\code{(\var{begin_y}, \var{begin_x})}, and whose width/height is
|
||||||
\var{ncols}/\var{nlines}.
|
\var{ncols}/\var{nlines}.
|
||||||
|
|
||||||
|
By default, the sub-window will extend from the
|
||||||
|
specified position to the lower right corner of the window.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{addch}{\optional{y, x,} ch\optional{, attr}}
|
\begin{methoddesc}{addch}{\optional{y, x,} ch\optional{, attr}}
|
||||||
|
@ -217,7 +225,7 @@ character.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{delch}{\optional{x, y}}
|
\begin{methoddesc}{delch}{\optional{x, y}}
|
||||||
Delete any character at \code{(y,x)}.
|
Delete any character at \code{(\var{y}, \var{x})}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{echochar}{ch\optional{, attr}}
|
\begin{methoddesc}{echochar}{ch\optional{, attr}}
|
||||||
|
@ -226,44 +234,59 @@ call \method{refresh}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{addstr}{\optional{y, x,} str\optional{, attr}}
|
\begin{methoddesc}{addstr}{\optional{y, x,} str\optional{, attr}}
|
||||||
Paint string \var{str} at \code{(y,x)} with attributes \var{attr}, overwriting
|
Paint string \var{str} at \code{(\var{y}, \var{x})} with attributes
|
||||||
anything previously on the display.
|
\var{attr}, overwriting anything previously on the display.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{attron}{attr}
|
\begin{methoddesc}{attron}{attr}
|
||||||
Turn on attribute \var{attr} at current cursor location.
|
Turn on attribute \var{attr}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{attroff}{attr}
|
\begin{methoddesc}{attroff}{attr}
|
||||||
Turn off attribute \var{attr} at current cursor location.
|
Turn off attribute \var{attr}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{setattr}{attr}
|
\begin{methoddesc}{setattr}{attr}
|
||||||
Set the attributes at the current cursor location to \var{attr}.
|
Set the current attributes to \var{attr}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{standend}{}
|
\begin{methoddesc}{standend}{}
|
||||||
Turn off all attributes at current cusor location.
|
Turn off all attributes.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{standout}{}
|
\begin{methoddesc}{standout}{}
|
||||||
Turn on attribute \var{A_STANDOUT}.
|
Turn on attribute \var{A_STANDOUT}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{border}{ls\code{ = ACS_VLINE}, rs\code{ = ACS_VLINE},
|
\begin{methoddesc}{border}{\optional{ls\optional{, rs\optional{, ts\optional{,
|
||||||
ts\code{ = ACS_HLINE}, bs\code{ = ACS_HLINE},
|
bs\optional{, tl\optional{, tr\optional{,
|
||||||
tl\code{ = ACS_ULCORNER}, tr\code{ = ACS_URCORNER},
|
bl\optional{, br}}}}}}}}}
|
||||||
bl\code{ = ACS_BLCORNER}, br\code{ = ACS_BRCORNER}}
|
Draw a border around the edges of the window. Each parameter specifies
|
||||||
Draw a border around the edges of the window. The arguments are
|
the character to use for a specific part of the border; see the table
|
||||||
respectively, the character to use for the left side, the right side
|
below for more details. The characters must be specified as integers;
|
||||||
the top side, the bottom side, the top-left corner, the top-right
|
using one-character strings will cause \exception{TypeError} to be
|
||||||
corner, the bottom-left corner and the bottom-right corner.
|
raised.
|
||||||
|
|
||||||
|
\strong{Note:} A \code{0} value for any parameter will cause the
|
||||||
|
default character to be used for that parameter. Keyword parameters
|
||||||
|
can \emph{not} be used. The defaults are listed in this table:
|
||||||
|
|
||||||
|
\begin{tableiii}{l|l|l}{var}{Parameter}{Description}{Default value}
|
||||||
|
\lineiii{ls}{Left side}{\constant{ACS_VLINE}}
|
||||||
|
\lineiii{rs}{Right side}{\constant{ACS_VLINE}}
|
||||||
|
\lineiii{ts}{Top}{\constant{ACS_HLINE}}
|
||||||
|
\lineiii{bs}{Bottom}{\constant{ACS_HLINE}}
|
||||||
|
\lineiii{tl}{Upper-left corner}{\constant{ACS_ULCORNER}}
|
||||||
|
\lineiii{tr}{Upper-right corner}{\constant{ACS_URCORNER}}
|
||||||
|
\lineiii{bl}{Bottom-left corner}{\constant{ACS_BLCORNER}}
|
||||||
|
\lineiii{br}{Bottom-right corner}{\constant{ACS_BRCORNER}}
|
||||||
|
\end{tableiii}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{box}{vertch\code{ = ACS_VLINE}, horch\code{ = ACS_HLINE}}
|
\begin{methoddesc}{box}{\optional{vertch, horch}}
|
||||||
Same as \method{border}, but both \var{ls} and \var{rs} are \var{vertch}
|
Similar to \method{border()}, but both \var{ls} and \var{rs} are
|
||||||
and both \var{ts} and {bs} are \var{horch}. The corners are non-overridable
|
\var{vertch} and both \var{ts} and {bs} are \var{horch}. The default
|
||||||
by this function.
|
corner characters are always used by this function.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{hline}{\optional{y, x,} ch, n}
|
\begin{methoddesc}{hline}{\optional{y, x,} ch, n}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue