Introduction to curses.textpad

Introduction to curses.textpad


The curses module provides an interface to the curses library, While curses is mostly used in the Unix environment, versions are available for Windows, DOS, and possibly other systems as well. The extension module is designed to match the API of ncurses, an open-source curses library hosted on Linux and the BSD variants of Unix.


The curses.textpad module provides a Textbox class which handles elementary text editing in a curses window,which further on supports a set of keybindings resembling those of Emacs (thus, also of Netscape Navigator, BBedit 6.x, FrameMaker etc.). This module also provides a rectangle-drawing function which is useful for framing text boxes or for other purposes.

The module provides the following function:

curses.textpad.rectangle(win, uly, ulx, lry, lrx):
It Draws a rectangle. The first argument is 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. 

next we will learn textbox object 

Next =>