(stdscr)
| 192 | |
| 193 | if __name__ == '__main__': |
| 194 | def test_editbox(stdscr): |
| 195 | ncols, nlines = 9, 4 |
| 196 | uly, ulx = 15, 20 |
| 197 | stdscr.addstr(uly-2, ulx, "Use Ctrl-G to end editing.") |
| 198 | win = curses.newwin(nlines, ncols, uly, ulx) |
| 199 | rectangle(stdscr, uly-1, ulx-1, uly + nlines, ulx + ncols) |
| 200 | stdscr.refresh() |
| 201 | return Textbox(win).edit() |
| 202 | |
| 203 | str = curses.wrapper(test_editbox) |
| 204 | print('Contents of text box:', repr(str)) |