Roland Brickl <[EMAIL PROTECTED]> added the comment:

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.

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4254>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to