#11363: add missing functions from curses doc. Patch by Sandro Tosi.

This commit is contained in:
Ezio Melotti 2011-06-26 13:34:56 +03:00
parent b6b7371329
commit 4850d52b4d
1 changed files with 48 additions and 0 deletions

View File

@ -296,6 +296,12 @@ The module :mod:`curses` defines the following functions:
cause the interpreter to exit.
.. function:: is_term_resized(nlines, ncols)
Return ``True`` if :func:`resize_term` would modify the window structure,
``False`` otherwise.
.. function:: isendwin()
Return ``True`` if :func:`endwin` has been called (that is, the curses library has
@ -465,6 +471,35 @@ The module :mod:`curses` defines the following functions:
:func:`def_shell_mode`.
.. function:: resetty()
Restore the state of the terminal modes to what it was at the last call to
:func:`savetty`.
.. function:: resize_term(nlines, ncols)
Backend function used by :func:`resizeterm`, performing most of the work;
when resizing the windows, :func:`resize_term` blank-fills the areas that are
extended. The calling application should fill in these areas with
appropriate data. The :func:`resize_term` function attempts to resize all
windows. However, due to the calling convention of pads, it is not possible
to resize these without additional interaction with the application.
.. function:: resizeterm(nlines, ncols)
Resize the standard and current windows to the specified dimensions, and
adjusts other bookkeeping data used by the curses library that record the
window dimensions (in particular the SIGWINCH handler).
.. function:: savetty()
Save the current state of the terminal modes in a buffer, usable by
:func:`resetty`.
.. function:: setsyx(y, x)
Set the virtual screen cursor to *y*, *x*. If *y* and *x* are both -1, then
@ -798,6 +833,11 @@ the following methods:
Return a tuple ``(y, x)`` of co-ordinates of upper-left corner.
.. method:: window.getbkgd()
Return the given window's current background character/attribute pair.
.. method:: window.getch([y, x])
Get a character. Note that the integer returned does *not* have to be in ASCII
@ -1043,6 +1083,14 @@ the following methods:
*sminrow*, or *smincol* are treated as if they were zero.
.. method:: window.resize(nlines, ncols)
Reallocate storage for a curses window to adjust its dimensions to the
specified values. If either dimension is larger than the current values, the
window's data is filled with blanks that have the current background
rendition (as set by :meth:`bkgdset`) merged into them.
.. method:: window.scroll([lines=1])
Scroll the screen or scrolling region upward by *lines* lines.