Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0bccd73

Browse files
committed
Updates from Moshe, again edited by me. Describe the parameters to
border() using a table instead of text for ease of comprehension.
1 parent 92f3f41 commit 0bccd73

1 file changed

Lines changed: 50 additions & 27 deletions

File tree

Doc/lib/libcurses.tex

Lines changed: 50 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ \subsection{Constants and Functions \label{curses-functions}}
8282
Curses function returned an error status.
8383
\end{excdesc}
8484

85+
\strong{Note:} Whenever \var{x} or \var{y} arguments to a function
86+
or a method are optional, they default to the current cursor location.
87+
Whenever \var{attr} is optional, it defaults to \constant{A_NORMAL}.
88+
8589
The module \module{curses} defines the following functions:
8690

8791
\begin{funcdesc}{initscr}{}
@@ -104,7 +108,9 @@ \subsection{Constants and Functions \label{curses-functions}}
104108
\begin{funcdesc}{newwin}{\optional{nlines, ncols,} begin_y, begin_x}
105109
Return a new window, whose left-upper corner is at
106110
\code{(\var{begin_y}, \var{begin_x})}, and whose height/width is
107-
\var{nlines}/\var{ncols}. By default, the window will extend from the
111+
\var{nlines}/\var{ncols}.
112+
113+
By default, the window will extend from the
108114
specified position to the lower right corner of the screen.
109115
\end{funcdesc}
110116

@@ -176,27 +182,29 @@ \subsection{Window Objects \label{curses-window-objects}}
176182
following methods:
177183

178184
\begin{methoddesc}{refresh}{}
179-
Do refresh (sync actual screen with previous drawing/deleting
180-
methods.)
185+
Update the display immediately (sync actual screen with previous
186+
drawing/deleting methods).
181187
\end{methoddesc}
182188

183189
\begin{methoddesc}{nooutrefresh}{}
184190
Mark for refresh but wait.
185191
\end{methoddesc}
186192

187193
\begin{methoddesc}{mvwin}{new_y, new_x}
188-
Move the window so its upper-left corner is at \code{(new_y, new_x)}.
194+
Move the window so its upper-left corner is at \code{(\var{new_y}, \var{new_x})}.
189195
\end{methoddesc}
190196

191197
\begin{methoddesc}{move}{new_y, new_x}
192198
Move cursor to \code{(\var{new_y}, \var{new_x})}.
193199
\end{methoddesc}
194200

195-
\begin{methoddesc}{subwin}{nlines=HEIGTH-begin_y, ncols=WIDTH-begin_x,
196-
begin_y, begin_y}
201+
\begin{methoddesc}{subwin}{\optional{nlines, ncols,} begin_y, begin_y}
197202
Return a sub-window, whose upper-left corner is at
198203
\code{(\var{begin_y}, \var{begin_x})}, and whose width/height is
199204
\var{ncols}/\var{nlines}.
205+
206+
By default, the sub-window will extend from the
207+
specified position to the lower right corner of the window.
200208
\end{methoddesc}
201209

202210
\begin{methoddesc}{addch}{\optional{y, x,} ch\optional{, attr}}
@@ -217,7 +225,7 @@ \subsection{Window Objects \label{curses-window-objects}}
217225
\end{methoddesc}
218226

219227
\begin{methoddesc}{delch}{\optional{x, y}}
220-
Delete any character at \code{(y,x)}.
228+
Delete any character at \code{(\var{y}, \var{x})}.
221229
\end{methoddesc}
222230

223231
\begin{methoddesc}{echochar}{ch\optional{, attr}}
@@ -226,44 +234,59 @@ \subsection{Window Objects \label{curses-window-objects}}
226234
\end{methoddesc}
227235

228236
\begin{methoddesc}{addstr}{\optional{y, x,} str\optional{, attr}}
229-
Paint string \var{str} at \code{(y,x)} with attributes \var{attr}, overwriting
230-
anything previously on the display.
237+
Paint string \var{str} at \code{(\var{y}, \var{x})} with attributes
238+
\var{attr}, overwriting anything previously on the display.
231239
\end{methoddesc}
232240

233241
\begin{methoddesc}{attron}{attr}
234-
Turn on attribute \var{attr} at current cursor location.
242+
Turn on attribute \var{attr}.
235243
\end{methoddesc}
236244

237245
\begin{methoddesc}{attroff}{attr}
238-
Turn off attribute \var{attr} at current cursor location.
246+
Turn off attribute \var{attr}.
239247
\end{methoddesc}
240248

241249
\begin{methoddesc}{setattr}{attr}
242-
Set the attributes at the current cursor location to \var{attr}.
250+
Set the current attributes to \var{attr}.
243251
\end{methoddesc}
244252

245253
\begin{methoddesc}{standend}{}
246-
Turn off all attributes at current cusor location.
254+
Turn off all attributes.
247255
\end{methoddesc}
248256

249257
\begin{methoddesc}{standout}{}
250258
Turn on attribute \var{A_STANDOUT}.
251259
\end{methoddesc}
252260

253-
\begin{methoddesc}{border}{ls\code{ = ACS_VLINE}, rs\code{ = ACS_VLINE},
254-
ts\code{ = ACS_HLINE}, bs\code{ = ACS_HLINE},
255-
tl\code{ = ACS_ULCORNER}, tr\code{ = ACS_URCORNER},
256-
bl\code{ = ACS_BLCORNER}, br\code{ = ACS_BRCORNER}}
257-
Draw a border around the edges of the window. The arguments are
258-
respectively, the character to use for the left side, the right side
259-
the top side, the bottom side, the top-left corner, the top-right
260-
corner, the bottom-left corner and the bottom-right corner.
261-
\end{methoddesc}
262-
263-
\begin{methoddesc}{box}{vertch\code{ = ACS_VLINE}, horch\code{ = ACS_HLINE}}
264-
Same as \method{border}, but both \var{ls} and \var{rs} are \var{vertch}
265-
and both \var{ts} and {bs} are \var{horch}. The corners are non-overridable
266-
by this function.
261+
\begin{methoddesc}{border}{\optional{ls\optional{, rs\optional{, ts\optional{,
262+
bs\optional{, tl\optional{, tr\optional{,
263+
bl\optional{, br}}}}}}}}}
264+
Draw a border around the edges of the window. Each parameter specifies
265+
the character to use for a specific part of the border; see the table
266+
below for more details. The characters must be specified as integers;
267+
using one-character strings will cause \exception{TypeError} to be
268+
raised.
269+
270+
\strong{Note:} A \code{0} value for any parameter will cause the
271+
default character to be used for that parameter. Keyword parameters
272+
can \emph{not} be used. The defaults are listed in this table:
273+
274+
\begin{tableiii}{l|l|l}{var}{Parameter}{Description}{Default value}
275+
\lineiii{ls}{Left side}{\constant{ACS_VLINE}}
276+
\lineiii{rs}{Right side}{\constant{ACS_VLINE}}
277+
\lineiii{ts}{Top}{\constant{ACS_HLINE}}
278+
\lineiii{bs}{Bottom}{\constant{ACS_HLINE}}
279+
\lineiii{tl}{Upper-left corner}{\constant{ACS_ULCORNER}}
280+
\lineiii{tr}{Upper-right corner}{\constant{ACS_URCORNER}}
281+
\lineiii{bl}{Bottom-left corner}{\constant{ACS_BLCORNER}}
282+
\lineiii{br}{Bottom-right corner}{\constant{ACS_BRCORNER}}
283+
\end{tableiii}
284+
\end{methoddesc}
285+
286+
\begin{methoddesc}{box}{\optional{vertch, horch}}
287+
Similar to \method{border()}, but both \var{ls} and \var{rs} are
288+
\var{vertch} and both \var{ts} and {bs} are \var{horch}. The default
289+
corner characters are always used by this function.
267290
\end{methoddesc}
268291

269292
\begin{methoddesc}{hline}{\optional{y, x,} ch, n}

0 commit comments

Comments
 (0)