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 nemesis
Recipients nemesis, vstinner
Date 2008-11-03.16:36:04
SpamBayes Score 0.00039861252
Marked as misclassified No
Message-id <1225730165.77.0.551671726874.issue4254@psf.upfronthosting.co.za>
In-reply-to
Content
Hi Victor,

i use this to get updated versions of curses.COLS and curses.LINES in 
the fact of an curses.KEY_RESIZE event.
So i can use curses within python even without to have panels.
It seems that curses.panel are the prefered way to deal with terminal 
resizes.
The curses.resize[_]term() are only to change the terminal manualy.
What i also found in PyTone is more or less this functionality from 
update_lines_cols():

def getmaxyx(self):
    # taken from http://dag.wieers.com/home-made/dstat/
    try:
        h, w = int(os.environ["LINES"]), int(os.environ["COLUMNS"])
    except KeyError:
        try:
            h, w = curses.tigetnum('lines'), curses.tigetnum('cols')
        except:
            try:
                s = struct.pack('HHHH', 0, 0, 0, 0)
                x = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ,
s)
                h, w = struct.unpack('HHHH', x)[:2]
            except:
                h, w = 25, 80

And please excuse me for the missing documentation. English aren't my 
native language so i would document it like:
Updates curses.LINES and curses.COLS :)

It's my first day here on the issue tracker.
History
Date User Action Args
2008-11-03 16:36:05nemesissetrecipients: + nemesis, vstinner
2008-11-03 16:36:05nemesissetmessageid: <1225730165.77.0.551671726874.issue4254@psf.upfronthosting.co.za>
2008-11-03 16:36:05nemesislinkissue4254 messages
2008-11-03 16:36:04nemesiscreate