PyDocs

Nav

Command-line interface libraries

window

curses

classnot Androidnot iOSnot WASI
A curses window.

Window objects are returned by initscr() and newwin(), and by the
methods that create subwindows and pads.
Members of window

a

addch
Paint the character.
addnstr
Paint at most n characters of the string.
addstr
Paint the string.
attroff
Remove attribute attr from the "background" set.
attron
Add attribute attr to the "background" set.
attrset
Set the "background" set of attributes.

b

bkgd
Set the background property of the window.
bkgdset
Set the window's background.
border
Draw a border around the edges of the window.
box
Draw a border around the edges of the window.

c

chgat
Set the attributes of characters.
clear
Clear the window and repaint it completely on the next refresh().
clearok
Clear the window on the next refresh() if flag is true.
clrtobot
Erase from the cursor to the end of the window.
clrtoeol
Erase from the cursor to the end of the line.
cursyncup
Update the cursor position of all ancestor windows to match.

d

delch
Delete the character under the cursor, or at (y, x) if specified.
deleteln
Delete the line under the cursor; move following lines up by one.
derwin
Create a sub-window (window-relative coordinates).

e

echochar
Add character ch with attribute attr, and refresh.
enclose
Return True if the screen-relative coordinates are enclosed by the window.
encoding
the typecode character used to create the array
erase
Clear the window.

g

get_wch
Read a key press and return it as a one-character str.
getbegyx
Return a tuple (y, x) of the upper-left corner coordinates.
getbkgd
Return the window's current background character/attribute pair.
getch
Read a key press and return it as an integer.
getkey
Read a key press and return it as a str.
getmaxyx
Return a tuple (y, x) of the window height and width.
getparyx
Return (y, x) relative to the parent window, or (-1, -1) if none.
getstr
Read a line of input and return it as a bytes object.
getyx
Return a tuple (y, x) of the current cursor position.

h

hline
Display a horizontal line.

i

idcok
Enable or disable the hardware insert/delete character feature.
idlok
Enable or disable the hardware insert/delete line feature.
immedok
If flag is true, refresh the window on every change to it.
inch
Return the character at the given position in the window.
insch
Insert a character before the current or specified position.
insdelln
Insert (nlines > 0) or delete (nlines < 0) lines above the cursor.
insertln
Insert a blank line under the cursor; move following lines down.
insnstr
Insert at most n characters of the string.
insstr
Insert the string before the current or specified position.
instr
Return the text of the window as a bytes object.
is_linetouched
Return True if the specified line was modified, otherwise return False.
is_wintouched
Return True if the window changed since the last refresh().

k

keypad
Interpret escape sequences for special keys if flag is true.

l

leaveok
If flag is true, leave the cursor where the update leaves it.

m

move
Move the cursor to (new_y, new_x).
mvderwin
Move the window inside its parent window.
mvwin
Move the window so its upper-left corner is at (new_y, new_x).

n

nodelay
If flag is true, getch() becomes non-blocking.
notimeout
If flag is true, do not time out escape sequences.
noutrefresh
Mark for refresh but wait.

o

overlay
Overlay the window on top of destwin.
overwrite
overwrite(destwin, [sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol]) Overwrite the window on top of destwin.

p

putwin
Write all data associated with the window into the provided file object.

r

redrawln
Mark the specified lines corrupted.
redrawwin
Mark the entire window for redraw on the next refresh().
refresh
Update the display immediately.
resize
Resize the window to nlines rows and ncols columns.

s

scroll
Scroll the screen or scrolling region.
scrollok
Control whether the window scrolls when the cursor moves off it.
setscrreg
Define a software scrolling region.
standend
Turn off the standout attribute.
standout
Turn on the A_STANDOUT attribute.
subpad
Create a sub-window (screen-relative coordinates).
subwin
Create a sub-window (screen-relative coordinates).
syncdown
Touch each location changed in any ancestor of the window.
syncok
If flag is true, call syncup() on every change to the window.
syncup
Touch locations in ancestors that changed in this window.

t

timeout
Set blocking or non-blocking read behavior for the window.
touchline
Pretend count lines have been changed, starting with line start.
touchwin
Mark the whole window as changed.

u

untouchwin
Mark all lines in the window as unchanged since last refresh().

v

vline
Display a vertical line.
0 Examples
No examples for curses/window.
See Also
No see-alsos for curses/window
0 Notes
No notes for window