Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / amd64 / html / python / lib / curses-window-objects.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python Documentation Index' />
<link rel="first" href="lib.html" title='Python Library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="node267.html" />
<link rel="prev" href="curses-functions.html" />
<link rel="parent" href="module-curses.html" />
<link rel="next" href="node267.html" />
<meta name='aesop' content='information' />
<title>6.15.2 Window Objects </title>
</head>
<body>
<DIV CLASS="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="6.15.1 Functions"
href="curses-functions.html"><img src='../icons/previous.png'
border='0' height='32' alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="6.15 curses "
href="module-curses.html"><img src='../icons/up.png'
border='0' height='32' alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="6.15.3 Constants"
href="node267.html"><img src='../icons/next.png'
border='0' height='32' alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='../icons/contents.png'
border='0' height='32' alt='Contents' width='32' /></A></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
border='0' height='32' alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
href="genindex.html"><img src='../icons/index.png'
border='0' height='32' alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="curses-functions.html">6.15.1 Functions</A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-curses.html">6.15 curses </A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node267.html">6.15.3 Constants</A>
</div>
<hr /></div>
</DIV>
<!--End of Navigation Panel-->
<H2><A NAME="SECTION0081520000000000000000"></A><A NAME="curses-window-objects"></A>
<BR>
6.15.2 Window Objects
</H2>
<P>
Window objects, as returned by <tt class="function">initscr()</tt> and
<tt class="function">newwin()</tt> above, have the
following methods:
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2072' xml:id='l2h-2072' class="method">addch</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>y, x,</var><big>]</big><var> ch</var><big>[</big><var>, attr</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
<span class="note"><b class="label">Note:</b>
A <em>character</em> means a C character (an
ASCII code), rather then a Python character (a string of length 1).
(This note is true whenever the documentation mentions a character.)
The builtin <tt class="function">ord()</tt> is handy for conveying strings to codes.</span>
<P>
Paint character <var>ch</var> at <code>(<var>y</var>, <var>x</var>)</code> with attributes
<var>attr</var>, overwriting any character previously painter at that
location. By default, the character position and attributes are the
current settings for the window object.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2073' xml:id='l2h-2073' class="method">addnstr</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>y, x,</var><big>]</big><var> str, n</var><big>[</big><var>, attr</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Paint at most <var>n</var> characters of the
string <var>str</var> at <code>(<var>y</var>, <var>x</var>)</code> with attributes
<var>attr</var>, overwriting anything previously on the display.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2074' xml:id='l2h-2074' class="method">addstr</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>y, x,</var><big>]</big><var> str</var><big>[</big><var>, attr</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Paint the string <var>str</var> at <code>(<var>y</var>, <var>x</var>)</code> with attributes
<var>attr</var>, overwriting anything previously on the display.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2075' xml:id='l2h-2075' class="method">attroff</tt></b>(</nobr></td>
<td><var>attr</var>)</td></tr></table></dt>
<dd>
Remove attribute <var>attr</var> from the ``background'' set applied to all
writes to the current window.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2076' xml:id='l2h-2076' class="method">attron</tt></b>(</nobr></td>
<td><var>attr</var>)</td></tr></table></dt>
<dd>
Add attribute <var>attr</var> from the ``background'' set applied to all
writes to the current window.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2077' xml:id='l2h-2077' class="method">attrset</tt></b>(</nobr></td>
<td><var>attr</var>)</td></tr></table></dt>
<dd>
Set the ``background'' set of attributes to <var>attr</var>. This set is
initially 0 (no attributes).
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2078' xml:id='l2h-2078' class="method">bkgd</tt></b>(</nobr></td>
<td><var>ch</var><big>[</big><var>, attr</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Sets the background property of the window to the character <var>ch</var>,
with attributes <var>attr</var>. The change is then applied to every
character position in that window:
<UL>
<LI>The attribute of every character in the window is
changed to the new background attribute.
</LI>
<LI>Wherever the former background character appears,
it is changed to the new background character.
</LI>
</UL>
<P>
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2079' xml:id='l2h-2079' class="method">bkgdset</tt></b>(</nobr></td>
<td><var>ch</var><big>[</big><var>, attr</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Sets the window's background. A window's background consists of a
character and any combination of attributes. The attribute part of
the background is combined (OR'ed) with all non-blank characters that
are written into the window. Both the character and attribute parts
of the background are combined with the blank characters. The
background becomes a property of the character and moves with the
character through any scrolling and insert/delete line/character
operations.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2080' xml:id='l2h-2080' class="method">border</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>ls</var><big>[</big><var>, rs</var><big>[</big><var>,
ts</var><big>[</big><var>, bs</var><big>[</big><var>, tl</var><big>[</big><var>,
tr</var><big>[</big><var>, bl</var><big>[</big><var>, br</var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Draw a border around the edges of the window. Each parameter specifies
the character to use for a specific part of the border; see the table
below for more details. The characters can be specified as integers
or as one-character strings.
<P>
<span class="note"><b class="label">Note:</b>
A <code>0</code> value for any parameter will cause the
default character to be used for that parameter. Keyword parameters
can <em>not</em> be used. The defaults are listed in this table:</span>
<P>
<div class="center"><table class="realtable">
<thead>
<tr>
<th class="left" >Parameter</th>
<th class="left" >Description</th>
<th class="left" >Default value</th>
</tr>
</thead>
<tbody>
<tr><td class="left" valign="baseline"><var>ls</var></td>
<td class="left" >Left side</td>
<td class="left" ><tt class="constant">ACS_VLINE</tt></td></tr>
<tr><td class="left" valign="baseline"><var>rs</var></td>
<td class="left" >Right side</td>
<td class="left" ><tt class="constant">ACS_VLINE</tt></td></tr>
<tr><td class="left" valign="baseline"><var>ts</var></td>
<td class="left" >Top</td>
<td class="left" ><tt class="constant">ACS_HLINE</tt></td></tr>
<tr><td class="left" valign="baseline"><var>bs</var></td>
<td class="left" >Bottom</td>
<td class="left" ><tt class="constant">ACS_HLINE</tt></td></tr>
<tr><td class="left" valign="baseline"><var>tl</var></td>
<td class="left" >Upper-left corner</td>
<td class="left" ><tt class="constant">ACS_ULCORNER</tt></td></tr>
<tr><td class="left" valign="baseline"><var>tr</var></td>
<td class="left" >Upper-right corner</td>
<td class="left" ><tt class="constant">ACS_URCORNER</tt></td></tr>
<tr><td class="left" valign="baseline"><var>bl</var></td>
<td class="left" >Bottom-left corner</td>
<td class="left" ><tt class="constant">ACS_LLCORNER</tt></td></tr>
<tr><td class="left" valign="baseline"><var>br</var></td>
<td class="left" >Bottom-right corner</td>
<td class="left" ><tt class="constant">ACS_LRCORNER</tt></td></tr></tbody>
</table></div>
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2081' xml:id='l2h-2081' class="method">box</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>vertch, horch</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Similar to <tt class="method">border()</tt>, but both <var>ls</var> and <var>rs</var> are
<var>vertch</var> and both <var>ts</var> and bs are <var>horch</var>. The default
corner characters are always used by this function.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2082' xml:id='l2h-2082' class="method">clear</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Like <tt class="method">erase()</tt>, but also causes the whole window to be repainted
upon next call to <tt class="method">refresh()</tt>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2083' xml:id='l2h-2083' class="method">clearok</tt></b>(</nobr></td>
<td><var>yes</var>)</td></tr></table></dt>
<dd>
If <var>yes</var> is 1, the next call to <tt class="method">refresh()</tt>
will clear the window completely.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2084' xml:id='l2h-2084' class="method">clrtobot</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Erase from cursor to the end of the window: all lines below the cursor
are deleted, and then the equivalent of <tt class="method">clrtoeol()</tt> is performed.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2085' xml:id='l2h-2085' class="method">clrtoeol</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Erase from cursor to the end of the line.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2086' xml:id='l2h-2086' class="method">cursyncup</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Updates the current cursor position of all the ancestors of the window
to reflect the current cursor position of the window.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2087' xml:id='l2h-2087' class="method">delch</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>y, x</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Delete any character at <code>(<var>y</var>, <var>x</var>)</code>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2088' xml:id='l2h-2088' class="method">deleteln</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Delete the line under the cursor. All following lines are moved up
by 1 line.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2089' xml:id='l2h-2089' class="method">derwin</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>nlines, ncols,</var><big>]</big><var> begin_y, begin_x</var>)</td></tr></table></dt>
<dd>
An abbreviation for ``derive window'', <tt class="method">derwin()</tt> is the same
as calling <tt class="method">subwin()</tt>, except that <var>begin_y</var> and
<var>begin_x</var> are relative to the origin of the window, rather than
relative to the entire screen. Returns a window object for the
derived window.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2090' xml:id='l2h-2090' class="method">echochar</tt></b>(</nobr></td>
<td><var>ch</var><big>[</big><var>, attr</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Add character <var>ch</var> with attribute <var>attr</var>, and immediately
call <tt class="method">refresh()</tt> on the window.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2091' xml:id='l2h-2091' class="method">enclose</tt></b>(</nobr></td>
<td><var>y, x</var>)</td></tr></table></dt>
<dd>
Tests whether the given pair of screen-relative character-cell
coordinates are enclosed by the given window, returning true or
false. It is useful for determining what subset of the screen
windows enclose the location of a mouse event.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2092' xml:id='l2h-2092' class="method">erase</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Clear the window.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2093' xml:id='l2h-2093' class="method">getbegyx</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Return a tuple <code>(<var>y</var>, <var>x</var>)</code> of co-ordinates of upper-left
corner.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2094' xml:id='l2h-2094' class="method">getch</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>y, x</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Get a character. Note that the integer returned does <em>not</em> have to
be in ASCII range: function keys, keypad keys and so on return numbers
higher than 256. In no-delay mode, -1 is returned if there is
no input.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2095' xml:id='l2h-2095' class="method">getkey</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>y, x</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Get a character, returning a string instead of an integer, as
<tt class="method">getch()</tt> does. Function keys, keypad keys and so on return a
multibyte string containing the key name. In no-delay mode, an
exception is raised if there is no input.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2096' xml:id='l2h-2096' class="method">getmaxyx</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Return a tuple <code>(<var>y</var>, <var>x</var>)</code> of the height and width of
the window.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2097' xml:id='l2h-2097' class="method">getparyx</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Returns the beginning coordinates of this window relative to its
parent window into two integer variables y and x. Returns
<code>-1,-1</code> if this window has no parent.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2098' xml:id='l2h-2098' class="method">getstr</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>y, x</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Read a string from the user, with primitive line editing capacity.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2099' xml:id='l2h-2099' class="method">getyx</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Return a tuple <code>(<var>y</var>, <var>x</var>)</code> of current cursor position
relative to the window's upper-left corner.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2100' xml:id='l2h-2100' class="method">hline</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>y, x,</var><big>]</big><var> ch, n</var>)</td></tr></table></dt>
<dd>
Display a horizontal line starting at <code>(<var>y</var>, <var>x</var>)</code> with
length <var>n</var> consisting of the character <var>ch</var>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2101' xml:id='l2h-2101' class="method">idcok</tt></b>(</nobr></td>
<td><var>flag</var>)</td></tr></table></dt>
<dd>
If <var>flag</var> is false, curses no longer considers using the hardware
insert/delete character feature of the terminal; if <var>flag</var> is
true, use of character insertion and deletion is enabled. When curses
is first initialized, use of character insert/delete is enabled by
default.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2102' xml:id='l2h-2102' class="method">idlok</tt></b>(</nobr></td>
<td><var>yes</var>)</td></tr></table></dt>
<dd>
If called with <var>yes</var> equal to 1, <tt class="module">curses</tt> will try and use
hardware line editing facilities. Otherwise, line insertion/deletion
are disabled.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2103' xml:id='l2h-2103' class="method">immedok</tt></b>(</nobr></td>
<td><var>flag</var>)</td></tr></table></dt>
<dd>
If <var>flag</var> is true, any change in the window image
automatically causes the window to be refreshed; you no longer
have to call <tt class="method">refresh()</tt> yourself. However, it may
degrade performance considerably, due to repeated calls to
wrefresh. This option is disabled by default.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2104' xml:id='l2h-2104' class="method">inch</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>y, x</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Return the character at the given position in the window. The bottom
8 bits are the character proper, and upper bits are the attributes.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2105' xml:id='l2h-2105' class="method">insch</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>y, x,</var><big>]</big><var> ch</var><big>[</big><var>, attr</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Paint character <var>ch</var> at <code>(<var>y</var>, <var>x</var>)</code> with attributes
<var>attr</var>, moving the line from position <var>x</var> right by one
character.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2106' xml:id='l2h-2106' class="method">insdelln</tt></b>(</nobr></td>
<td><var>nlines</var>)</td></tr></table></dt>
<dd>
Inserts <var>nlines</var> lines into the specified window above the current
line. The <var>nlines</var> bottom lines are lost. For negative
<var>nlines</var>, delete <var>nlines</var> lines starting with the one under
the cursor, and move the remaining lines up. The bottom <var>nlines</var>
lines are cleared. The current cursor position remains the same.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2107' xml:id='l2h-2107' class="method">insertln</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Insert a blank line under the cursor. All following lines are moved
down by 1 line.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2108' xml:id='l2h-2108' class="method">insnstr</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>y, x,</var><big>]</big><var> str, n </var><big>[</big><var>, attr</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Insert a character string (as many characters as will fit on the line)
before the character under the cursor, up to <var>n</var> characters.
If <var>n</var> is zero or negative,
the entire string is inserted.
All characters to the right of
the cursor are shifted right, with the rightmost characters on the
line being lost. The cursor position does not change (after moving to
<var>y</var>, <var>x</var>, if specified).
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2109' xml:id='l2h-2109' class="method">insstr</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>y, x, </var><big>]</big><var> str </var><big>[</big><var>, attr</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Insert a character string (as many characters as will fit on the line)
before the character under the cursor. All characters to the right of
the cursor are shifted right, with the rightmost characters on the
line being lost. The cursor position does not change (after moving to
<var>y</var>, <var>x</var>, if specified).
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2110' xml:id='l2h-2110' class="method">instr</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>y, x</var><big>]</big><var> </var><big>[</big><var>, n</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Returns a string of characters, extracted from the window starting at
the current cursor position, or at <var>y</var>, <var>x</var> if specified.
Attributes are stripped from the characters. If <var>n</var> is specified,
<tt class="method">instr()</tt> returns return a string at most <var>n</var> characters
long (exclusive of the trailing NUL).
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2111' xml:id='l2h-2111' class="method">is_linetouched</tt></b>(</nobr></td>
<td><var><var>line</var></var>)</td></tr></table></dt>
<dd>
Returns true if the specified line was modified since the last call to
<tt class="method">refresh()</tt>; otherwise returns false. Raises a
<tt class="exception">curses.error</tt> exception if <var>line</var> is not valid
for the given window.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2112' xml:id='l2h-2112' class="method">is_wintouched</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Returns true if the specified window was modified since the last call to
<tt class="method">refresh()</tt>; otherwise returns false.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2113' xml:id='l2h-2113' class="method">keypad</tt></b>(</nobr></td>
<td><var>yes</var>)</td></tr></table></dt>
<dd>
If <var>yes</var> is 1, escape sequences generated by some keys (keypad,
function keys) will be interpreted by <tt class="module">curses</tt>.
If <var>yes</var> is 0, escape sequences will be left as is in the input
stream.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2114' xml:id='l2h-2114' class="method">leaveok</tt></b>(</nobr></td>
<td><var>yes</var>)</td></tr></table></dt>
<dd>
If <var>yes</var> is 1, cursor is left where it is on update, instead of
being at ``cursor position.'' This reduces cursor movement where
possible. If possible the cursor will be made invisible.
<P>
If <var>yes</var> is 0, cursor will always be at ``cursor position'' after
an update.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2115' xml:id='l2h-2115' class="method">move</tt></b>(</nobr></td>
<td><var>new_y, new_x</var>)</td></tr></table></dt>
<dd>
Move cursor to <code>(<var>new_y</var>, <var>new_x</var>)</code>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2116' xml:id='l2h-2116' class="method">mvderwin</tt></b>(</nobr></td>
<td><var>y, x</var>)</td></tr></table></dt>
<dd>
Moves the window inside its parent window. The screen-relative
parameters of the window are not changed. This routine is used to
display different parts of the parent window at the same physical
position on the screen.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2117' xml:id='l2h-2117' class="method">mvwin</tt></b>(</nobr></td>
<td><var>new_y, new_x</var>)</td></tr></table></dt>
<dd>
Move the window so its upper-left corner is at
<code>(<var>new_y</var>, <var>new_x</var>)</code>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2118' xml:id='l2h-2118' class="method">nodelay</tt></b>(</nobr></td>
<td><var>yes</var>)</td></tr></table></dt>
<dd>
If <var>yes</var> is <code>1</code>, <tt class="method">getch()</tt> will be non-blocking.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2119' xml:id='l2h-2119' class="method">notimeout</tt></b>(</nobr></td>
<td><var>yes</var>)</td></tr></table></dt>
<dd>
If <var>yes</var> is <code>1</code>, escape sequences will not be timed out.
<P>
If <var>yes</var> is <code>0</code>, after a few milliseconds, an escape sequence
will not be interpreted, and will be left in the input stream as is.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2120' xml:id='l2h-2120' class="method">noutrefresh</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Mark for refresh but wait. This function updates the data structure
representing the desired state of the window, but does not force
an update of the physical screen. To accomplish that, call
<tt class="function">doupdate()</tt>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2121' xml:id='l2h-2121' class="method">overlay</tt></b>(</nobr></td>
<td><var>destwin</var><big>[</big><var>, sminrow, smincol,
dminrow, dmincol, dmaxrow, dmaxcol</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Overlay the window on top of <var>destwin</var>. The windows need not be
the same size, only the overlapping region is copied. This copy is
non-destructive, which means that the current background character
does not overwrite the old contents of <var>destwin</var>.
<P>
To get fine-grained control over the copied region, the second form
of <tt class="method">overlay()</tt> can be used. <var>sminrow</var> and <var>smincol</var> are
the upper-left coordinates of the source window, and the other variables
mark a rectangle in the destination window.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2122' xml:id='l2h-2122' class="method">overwrite</tt></b>(</nobr></td>
<td><var>destwin</var><big>[</big><var>, sminrow, smincol,
dminrow, dmincol, dmaxrow, dmaxcol</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Overwrite the window on top of <var>destwin</var>. The windows need not be
the same size, in which case only the overlapping region is
copied. This copy is destructive, which means that the current
background character overwrites the old contents of <var>destwin</var>.
<P>
To get fine-grained control over the copied region, the second form
of <tt class="method">overwrite()</tt> can be used. <var>sminrow</var> and <var>smincol</var> are
the upper-left coordinates of the source window, the other variables
mark a rectangle in the destination window.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2123' xml:id='l2h-2123' class="method">putwin</tt></b>(</nobr></td>
<td><var>file</var>)</td></tr></table></dt>
<dd>
Writes all data associated with the window into the provided file
object. This information can be later retrieved using the
<tt class="function">getwin()</tt> function.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2124' xml:id='l2h-2124' class="method">redrawln</tt></b>(</nobr></td>
<td><var>beg, num</var>)</td></tr></table></dt>
<dd>
Indicates that the <var>num</var> screen lines, starting at line <var>beg</var>,
are corrupted and should be completely redrawn on the next
<tt class="method">refresh()</tt> call.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2125' xml:id='l2h-2125' class="method">redrawwin</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Touches the entire window, causing it to be completely redrawn on the
next <tt class="method">refresh()</tt> call.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2126' xml:id='l2h-2126' class="method">refresh</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>pminrow, pmincol, sminrow,
smincol, smaxrow, smaxcol</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Update the display immediately (sync actual screen with previous
drawing/deleting methods).
<P>
The 6 optional arguments can only be specified when the window is a
pad created with <tt class="function">newpad()</tt>. The additional parameters are
needed to indicate what part of the pad and screen are involved.
<var>pminrow</var> and <var>pmincol</var> specify the upper left-hand corner of the
rectangle to be displayed in the pad. <var>sminrow</var>, <var>smincol</var>,
<var>smaxrow</var>, and <var>smaxcol</var> 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
coordinates, since the rectangles must be the same size. Both
rectangles must be entirely contained within their respective
structures. Negative values of <var>pminrow</var>, <var>pmincol</var>,
<var>sminrow</var>, or <var>smincol</var> are treated as if they were zero.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2127' xml:id='l2h-2127' class="method">scroll</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>lines<code> = 1</code></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Scroll the screen or scrolling region upward by <var>lines</var> lines.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2128' xml:id='l2h-2128' class="method">scrollok</tt></b>(</nobr></td>
<td><var>flag</var>)</td></tr></table></dt>
<dd>
Controls what happens when the cursor of a window is moved off the
edge of the window or scrolling region, either as a result of a
newline action on the bottom line, or typing the last character
of the last line. If <var>flag</var> is false, the cursor is left
on the bottom line. If <var>flag</var> is true, the window is
scrolled up one line. Note that in order to get the physical
scrolling effect on the terminal, it is also necessary to call
<tt class="method">idlok()</tt>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2129' xml:id='l2h-2129' class="method">setscrreg</tt></b>(</nobr></td>
<td><var>top, bottom</var>)</td></tr></table></dt>
<dd>
Set the scrolling region from line <var>top</var> to line <var>bottom</var>. All
scrolling actions will take place in this region.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2130' xml:id='l2h-2130' class="method">standend</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Turn off the standout attribute. On some terminals this has the
side effect of turning off all attributes.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2131' xml:id='l2h-2131' class="method">standout</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Turn on attribute <var>A_STANDOUT</var>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2132' xml:id='l2h-2132' class="method">subpad</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>nlines, ncols,</var><big>]</big><var> begin_y, begin_x</var>)</td></tr></table></dt>
<dd>
Return a sub-window, whose upper-left corner is at
<code>(<var>begin_y</var>, <var>begin_x</var>)</code>, and whose width/height is
<var>ncols</var>/<var>nlines</var>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2133' xml:id='l2h-2133' class="method">subwin</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>nlines, ncols,</var><big>]</big><var> begin_y, begin_x</var>)</td></tr></table></dt>
<dd>
Return a sub-window, whose upper-left corner is at
<code>(<var>begin_y</var>, <var>begin_x</var>)</code>, and whose width/height is
<var>ncols</var>/<var>nlines</var>.
<P>
By default, the sub-window will extend from the
specified position to the lower right corner of the window.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2134' xml:id='l2h-2134' class="method">syncdown</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Touches each location in the window that has been touched in any of
its ancestor windows. This routine is called by <tt class="method">refresh()</tt>,
so it should almost never be necessary to call it manually.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2135' xml:id='l2h-2135' class="method">syncok</tt></b>(</nobr></td>
<td><var>flag</var>)</td></tr></table></dt>
<dd>
If called with <var>flag</var> set to true, then <tt class="method">syncup()</tt> is
called automatically whenever there is a change in the window.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2136' xml:id='l2h-2136' class="method">syncup</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Touches all locations in ancestors of the window that have been changed in
the window.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2137' xml:id='l2h-2137' class="method">timeout</tt></b>(</nobr></td>
<td><var>delay</var>)</td></tr></table></dt>
<dd>
Sets blocking or non-blocking read behavior for the window. If
<var>delay</var> is negative, blocking read is used (which will wait
indefinitely for input). If <var>delay</var> is zero, then non-blocking
read is used, and -1 will be returned by <tt class="method">getch()</tt> if no input
is waiting. If <var>delay</var> is positive, then <tt class="method">getch()</tt> will
block for <var>delay</var> milliseconds, and return -1 if there is still no
input at the end of that time.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2138' xml:id='l2h-2138' class="method">touchline</tt></b>(</nobr></td>
<td><var>start, count</var>)</td></tr></table></dt>
<dd>
Pretend <var>count</var> lines have been changed, starting with line
<var>start</var>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2139' xml:id='l2h-2139' class="method">touchwin</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Pretend the whole window has been changed, for purposes of drawing
optimizations.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2140' xml:id='l2h-2140' class="method">untouchwin</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Marks all lines in the window as unchanged since the last call to
<tt class="method">refresh()</tt>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2141' xml:id='l2h-2141' class="method">vline</tt></b>(</nobr></td>
<td><var></var><big>[</big><var>y, x,</var><big>]</big><var> ch, n</var>)</td></tr></table></dt>
<dd>
Display a vertical line starting at <code>(<var>y</var>, <var>x</var>)</code> with
length <var>n</var> consisting of the character <var>ch</var>.
</dl>
<P>
<DIV CLASS="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="6.15.1 Functions"
href="curses-functions.html"><img src='../icons/previous.png'
border='0' height='32' alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="6.15 curses "
href="module-curses.html"><img src='../icons/up.png'
border='0' height='32' alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="6.15.3 Constants"
href="node267.html"><img src='../icons/next.png'
border='0' height='32' alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='../icons/contents.png'
border='0' height='32' alt='Contents' width='32' /></A></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
border='0' height='32' alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
href="genindex.html"><img src='../icons/index.png'
border='0' height='32' alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="curses-functions.html">6.15.1 Functions</A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-curses.html">6.15 curses </A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node267.html">6.15.3 Constants</A>
</div>
</div>
<hr />
<span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span>
</DIV>
<!--End of Navigation Panel-->
<ADDRESS>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</ADDRESS>
</BODY>
</HTML>