.. function:: getwin(file)
- Read window related data stored in the file by an earlier :meth:`window.putwin` call.
+ Read window-related data stored in the file by an earlier :meth:`window.putwin` call.
The routine then creates and initializes a new window using that data, returning
the new window object. The *file* argument must be a file object opened for
reading in binary mode.
Return ``True`` if the module supports extended colors; otherwise, return
``False``. Extended color support allows more than 256 color pairs for
- terminals that support more than 16 colors (e.g. xterm-256color).
+ terminals that support more than 16 colors (for example, xterm-256color).
Extended color support requires ncurses version 6.1 or later.
methods of a pad require 6 arguments to specify the part of the pad to be
displayed and the location on the screen to be used for the display. The
arguments are *pminrow*, *pmincol*, *sminrow*, *smincol*, *smaxrow*, *smaxcol*; the *p*
- arguments refer to the upper left corner of the pad region to be displayed and
+ arguments refer to the upper-left corner of the pad region to be displayed and
the *s* arguments define a clipping box on the screen within which the pad region
is to be displayed.
.. function:: tparm(str[, ...])
Instantiate the bytes object *str* with the supplied parameters, where *str* should
- be a parameterized string obtained from the terminfo database. E.g.
+ be a parameterized string obtained from the terminfo database. For example,
``tparm(tigetstr("cup"), 5, 3)`` could result in ``b'\033[6;4H'``, the exact
result depending on terminal type. Up to nine integer parameters may be supplied.
.. _curses-window-objects:
-Window Objects
+Window objects
--------------
.. class:: window
.. note::
Writing outside the window, subwindow, or pad raises a :exc:`curses.error`.
- Attempting to write to the lower right corner of a window, subwindow,
+ Attempting to write to the lower-right corner of a window, subwindow,
or pad will cause an exception to be raised after the character is printed.
.. note::
* Writing outside the window, subwindow, or pad raises :exc:`curses.error`.
- Attempting to write to the lower right corner of a window, subwindow,
+ Attempting to write to the lower-right corner of a window, subwindow,
or pad will cause an exception to be raised after the string is printed.
* A bug in ncurses, the backend for this Python module, could cause
window.getstr(y, x, n)
Read a bytes object from the user, with primitive line editing capacity.
- At most *n* characters are read (2047 by default).
- The maximum value for *n* is 2047.
+ At most *n* characters are read;
+ *n* defaults to and cannot exceed 2047.
.. versionchanged:: 3.14
The maximum value for *n* was increased from 1023 to 2047.
The 6 arguments can only be specified, and are then required, when the window
is a pad created with :func:`newpad`. The additional parameters are needed to indicate what part
- of the pad and screen are involved. *pminrow* and *pmincol* specify the upper
- left-hand corner of the rectangle to be displayed in the pad. *sminrow*,
+ of the pad and screen are involved. *pminrow* and *pmincol* specify the
+ upper-left corner of the rectangle to be displayed in the pad. *sminrow*,
*smincol*, *smaxrow*, and *smaxcol* specify the edges of the rectangle to be
- displayed on the screen. The lower right-hand corner of the rectangle to be
+ displayed on the screen. The lower-right corner of the rectangle to be
displayed in the pad is calculated from the screen coordinates, since the
rectangles must be the same size. Both rectangles must be entirely contained
within their respective structures. Negative values of *pminrow*, *pmincol*,
.. data:: COLS
- The width of the screen, i.e., the number of columns.
+ The width of the screen, that is, the number of columns.
It is defined only after the call to :func:`initscr`.
Updated by :func:`update_lines_cols`, :func:`resizeterm` and
:func:`resize_term`.
.. data:: LINES
- The height of the screen, i.e., the number of lines.
+ The height of the screen, that is, the number of lines.
It is defined only after the call to :func:`initscr`.
Updated by :func:`update_lines_cols`, :func:`resizeterm` and
:func:`resize_term`.
+------------------------+------------------------------------------+
| ACS code | Meaning |
+========================+==========================================+
-| .. data:: ACS_BBSS | alternate name for upper right corner |
+| .. data:: ACS_BBSS | alternate name for upper-right corner |
+------------------------+------------------------------------------+
| .. data:: ACS_BLOCK | solid square block |
+------------------------+------------------------------------------+
+------------------------+------------------------------------------+
| .. data:: ACS_BSBS | alternate name for horizontal line |
+------------------------+------------------------------------------+
-| .. data:: ACS_BSSB | alternate name for upper left corner |
+| .. data:: ACS_BSSB | alternate name for upper-left corner |
+------------------------+------------------------------------------+
| .. data:: ACS_BSSS | alternate name for top tee |
+------------------------+------------------------------------------+
+------------------------+------------------------------------------+
| .. data:: ACS_LEQUAL | less-than-or-equal-to |
+------------------------+------------------------------------------+
-| .. data:: ACS_LLCORNER | lower left-hand corner |
+| .. data:: ACS_LLCORNER | lower-left corner |
+------------------------+------------------------------------------+
-| .. data:: ACS_LRCORNER | lower right-hand corner |
+| .. data:: ACS_LRCORNER | lower-right corner |
+------------------------+------------------------------------------+
| .. data:: ACS_LTEE | left tee |
+------------------------+------------------------------------------+
+------------------------+------------------------------------------+
| .. data:: ACS_S9 | scan line 9 |
+------------------------+------------------------------------------+
-| .. data:: ACS_SBBS | alternate name for lower right corner |
+| .. data:: ACS_SBBS | alternate name for lower-right corner |
+------------------------+------------------------------------------+
| .. data:: ACS_SBSB | alternate name for vertical line |
+------------------------+------------------------------------------+
| .. data:: ACS_SBSS | alternate name for right tee |
+------------------------+------------------------------------------+
-| .. data:: ACS_SSBB | alternate name for lower left corner |
+| .. data:: ACS_SSBB | alternate name for lower-left corner |
+------------------------+------------------------------------------+
| .. data:: ACS_SSBS | alternate name for bottom tee |
+------------------------+------------------------------------------+
+------------------------+------------------------------------------+
| .. data:: ACS_UARROW | up arrow |
+------------------------+------------------------------------------+
-| .. data:: ACS_ULCORNER | upper left corner |
+| .. data:: ACS_ULCORNER | upper-left corner |
+------------------------+------------------------------------------+
-| .. data:: ACS_URCORNER | upper right corner |
+| .. data:: ACS_URCORNER | upper-right corner |
+------------------------+------------------------------------------+
| .. data:: ACS_VLINE | vertical line |
+------------------------+------------------------------------------+
Draw a rectangle. The first argument must be a window object; the remaining
arguments are coordinates relative to that window. The second and third
- arguments are the y and x coordinates of the upper left hand corner of the
+ arguments are the y and x coordinates of the upper-left corner of the
rectangle to be drawn; the fourth and fifth arguments are the y and x
- coordinates of the lower right hand corner. The rectangle will be drawn using
+ coordinates of the lower-right corner. The rectangle will be drawn using
VT100/IBM PC forms characters on terminals that make this possible (including
xterm and most other software terminal emulators). Otherwise it will be drawn
with ASCII dashes, vertical bars, and plus signs.
be contained. If *insert_mode* is true, the textbox inserts typed
characters, shifting existing text to the right, rather than overwriting it.
The edit cursor of the textbox is initially located at the
- upper left hand corner of the containing window, with coordinates ``(0, 0)``.
+ upper-left corner of the containing window, with coordinates ``(0, 0)``.
The instance's :attr:`stripspaces` flag is initially on.
:class:`Textbox` objects have the following methods: