This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author doko
Recipients
Date 2004-07-04.11:33:05
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
[forwarded from http://bugs.debian.org/257472]

When derived windows of stdscr have been created,
shrinking the terminal produces a KEY_RESIZE event, but
getmaxyx() returns the previous terminal size. Only by
increasing the window size does it return the correct
terminal dimensions.

A minimal script to show this effect is included below.

#!/usr/bin/python
import curses, sys

def init_display(stdscr):
    stdscr.clear()
    stdscr.refresh()
    size = stdscr.getmaxyx()
    sys.stderr.write("Now %u x %u\n" % (size[1],size[0]))
    rootwin = stdscr.derwin(20, 50, 0, 0)
    return rootwin

def main(stdscr):
    rootwin = init_display(stdscr)
    while 1:
        input = rootwin.getch()
        if ( input == curses.KEY_RESIZE):
            init_display(stdscr)
        elif input == ord("q"):
            sys.exit()
        rootwin.refresh()

curses.wrapper(main)


History
Date User Action Args
2007-08-23 14:23:16adminlinkissue984870 messages
2007-08-23 14:23:16admincreate