Back to index

python3.2  3.2.2
Functions
test.curses_tests Namespace Reference

Functions

def test_textpad
def main

Function Documentation

def test.curses_tests.main (   stdscr)

Definition at line 39 of file curses_tests.py.

00039 
00040 def main(stdscr):
00041     stdscr.clear()
00042     test_textpad(stdscr, False)
00043     test_textpad(stdscr, True)
00044 

Here is the call graph for this function:

def test.curses_tests.test_textpad (   stdscr,
  insert_mode = False 
)

Definition at line 13 of file curses_tests.py.

00013 
00014 def test_textpad(stdscr, insert_mode=False):
00015     ncols, nlines = 8, 3
00016     uly, ulx = 3, 2
00017     if insert_mode:
00018         mode = 'insert mode'
00019     else:
00020         mode = 'overwrite mode'
00021 
00022     stdscr.addstr(uly-3, ulx, "Use Ctrl-G to end editing (%s)." % mode)
00023     stdscr.addstr(uly-2, ulx, "Be sure to try typing in the lower-right corner.")
00024     win = curses.newwin(nlines, ncols, uly, ulx)
00025     textpad.rectangle(stdscr, uly-1, ulx-1, uly + nlines, ulx + ncols)
00026     stdscr.refresh()
00027 
00028     box = textpad.Textbox(win, insert_mode)
00029     contents = box.edit()
00030     stdscr.addstr(uly+ncols+2, 0, "Text entered in the box\n")
00031     stdscr.addstr(repr(contents))
00032     stdscr.addstr('\n')
00033     stdscr.addstr('Press any key')
00034     stdscr.getch()
00035 
00036     for i in range(3):
00037         stdscr.move(uly+ncols+2 + i, 0)
00038         stdscr.clrtoeol()

Here is the caller graph for this function: