Patch for bug #1633621: if curses.resizeterm() or

curses.resize_term() is called, update _curses.LINES,
_curses.COLS, curses.LINES and curses.COLS.
This commit is contained in:
Walter Dörwald 2007-03-06 20:38:57 +00:00
parent 40c626159d
commit d391f0855c
2 changed files with 71 additions and 2 deletions

View file

@ -241,12 +241,21 @@ def test_userptr_without_set(stdscr):
except curses.panel.error:
pass
def test_resize_term(stdscr):
if hasattr(curses, 'resizeterm'):
lines, cols = curses.LINES, curses.COLS
curses.resizeterm(lines - 1, cols + 1)
if curses.LINES != lines - 1 or curses.COLS != cols + 1:
raise RuntimeError, "Expected resizeterm to update LINES and COLS"
def main(stdscr):
curses.savetty()
try:
module_funcs(stdscr)
window_funcs(stdscr)
test_userptr_without_set(stdscr)
test_resize_term(stdscr)
finally:
curses.resetty()