fixes a crash with the input is full

This commit is contained in:
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 2010-03-25 19:31:38 +00:00
parent 56ff4b760e
commit be67df542b
2 changed files with 4 additions and 3 deletions

View file

@ -112,7 +112,6 @@ class Gui(object):
def main_loop(self, stdscr): def main_loop(self, stdscr):
while 1: while 1:
stdscr.leaveok(1) stdscr.leaveok(1)
self.window.input.win.move(0, self.window.input.pos)
curses.doupdate() curses.doupdate()
try: try:
key = stdscr.getkey() key = stdscr.getkey()

View file

@ -28,13 +28,14 @@ class Win(object):
self.height, self.width, self.x, self.y = height, width, x, y self.height, self.width, self.x, self.y = height, width, x, y
try: try:
self.win = parent_win.subwin(height, width, y, x) self.win = parent_win.subwin(height, width, y, x)
self.win.leaveok(1)
except: except:
# Happens when the C function subwin fails. The man # Happens when the C function subwin fails. The man
# doesn't give a reason for this to happen, so I can't # doesn't give a reason for this to happen, so I can't
# really fix this. # really fix this.
# just don't crash when this happens. # just don't crash when this happens.
pass print parent_win, parent_win.height, parent_win.width, height, width, y, x
raise
self.win.leaveok(1)
def refresh(self): def refresh(self):
self.win.noutrefresh() self.win.noutrefresh()
@ -513,6 +514,7 @@ class Window(object):
Resize the whole tabe. i.e. all its sub-windows Resize the whole tabe. i.e. all its sub-windows
""" """
self.size = (self.height, self.width) = stdscr.getmaxyx() self.size = (self.height, self.width) = stdscr.getmaxyx()
open('caca', 'a').write(str(self.size))
if self.height < 10 or self.width < 60: if self.height < 10 or self.width < 60:
visible = False visible = False
else: else: