Message75470
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. |
|
Date |
User |
Action |
Args |
2008-11-03 16:36:05 | nemesis | set | recipients:
+ nemesis, vstinner |
2008-11-03 16:36:05 | nemesis | set | messageid: <1225730165.77.0.551671726874.issue4254@psf.upfronthosting.co.za> |
2008-11-03 16:36:05 | nemesis | link | issue4254 messages |
2008-11-03 16:36:04 | nemesis | create | |
|