curses.textpad.Textbox.do_command()

do_command(ch) Process a single command keystroke. Here are the supported special keystrokes: Keystroke Action Control-A Go to left edge of window. Control-B Cursor left, wrapping to previous line if appropriate. Control-D Delete character under cursor. Control-E Go to right edge (stripspaces off) or end of line (stripspaces on). Control-F Cursor right, wrapping to next line when appropriate. Control-G Terminate, returning the window contents. Control-H Delete character backward. Control-J T

curses.textpad.Textbox

class curses.textpad.Textbox(win) Return a textbox widget object. The win argument should be a curses WindowObject in which the textbox is to be contained. The edit cursor of the textbox is initially located at the upper left hand corner of the containing window, with coordinates (0, 0). The instance’s stripspaces flag is initially on. Textbox objects have the following methods: edit([validator]) This is the entry point you will normally use. It accepts editing keystrokes until one of the

curses.textpad.rectangle()

curses.textpad.rectangle(win, uly, ulx, lry, lrx) 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 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 VT100/IBM PC forms characters on terminals that make this possible (includi

curses.termname()

curses.termname() Return the value of the environment variable TERM, truncated to 14 characters.

curses.termattrs()

curses.termattrs() Return a logical OR of all video attributes supported by the terminal. This information is useful when a curses program needs complete control over the appearance of the screen.

curses.start_color()

curses.start_color() Must be called if the programmer wants to use colors, and before any other color manipulation routine is called. It is good practice to call this routine right after initscr(). start_color() initializes eight basic colors (black, red, green, yellow, blue, magenta, cyan, and white), and two global variables in the curses module, COLORS and COLOR_PAIRS, containing the maximum number of colors and color-pairs the terminal can support. It also restores the colors on the term

curses.setupterm()

curses.setupterm([termstr, fd]) Initialize the terminal. termstr is a string giving the terminal name; if omitted, the value of the TERM environment variable will be used. fd is the file descriptor to which any initialization sequences will be sent; if not supplied, the file descriptor for sys.stdout will be used.

curses.setsyx()

curses.setsyx(y, x) Set the virtual screen cursor to y, x. If y and x are both -1, then leaveok is set.

curses.savetty()

curses.savetty() Save the current state of the terminal modes in a buffer, usable by resetty().

curses.resize_term()

curses.resize_term(nlines, ncols) Backend function used by resizeterm(), performing most of the work; when resizing the windows, resize_term() blank-fills the areas that are extended. The calling application should fill in these areas with appropriate data. The 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.