Curses Subwin Resizing

Damian Johnson atagar1 at
Fri May 22 21:06:57 CEST 2009

Hi, I've been trying to make a curses application that's resilient to having
the terminal resized (like 'top'). I've managed to make it capable of
adjusting when the screen's width is changed (using getmaxyx) but changing
the height is proving a little trickier. I'm using subwindows so I can
selectively clear and redraw portions of the screen, however whenever the
screen's height is reduced it permanently shrinks (and moves) displaced
subwindows, so it can't recover when the screen's enlarged again. I've been
looking for hours for any of the following that would fix the problem...
... the ability to move and resize subwindows so I can restore them.
... the ability to delete subwindows so I can just receate them.
... the ability to selectively clear a rectangular region so I don't need
subwindows at all (I've spotted character deletion, but not region and it
seems kinda funky to tell curses to clear each cell individually).

This seems like it's probably a common problem but I haven't spotted a
solution. Any help would be appreciated! -Damian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list