diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-09-11 04:17:17 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-09-11 04:17:17 +0200 |
commit | 362ff75e3239110b596429fd142487add12e08a4 (patch) | |
tree | 0b405cd9ebe8b9a6edb5fdfcbb64e73a42fb59d8 /src/windows.py | |
parent | 1a485318bfc1a3db4cd970785029eeb8b03bf0b3 (diff) | |
download | poezio-362ff75e3239110b596429fd142487add12e08a4.tar.gz poezio-362ff75e3239110b596429fd142487add12e08a4.tar.bz2 poezio-362ff75e3239110b596429fd142487add12e08a4.tar.xz poezio-362ff75e3239110b596429fd142487add12e08a4.zip |
fixes crashes on too small size (except on the /configure tab, but that’s an other issue)
fixes #2186
Diffstat (limited to 'src/windows.py')
-rw-r--r-- | src/windows.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/windows.py b/src/windows.py index 7d138ad2..5b673c21 100644 --- a/src/windows.py +++ b/src/windows.py @@ -93,6 +93,12 @@ class Win(object): except: pass + def move(self, y, x): + try: + self._win.move(y, x) + except: + self._win.move(0, 0) + def addstr_colored(self, text, y=None, x=None): """ Write a string on the window, setting the @@ -105,7 +111,7 @@ class Win(object): one of 'u', 'b', 'c[0-9]' """ if y is not None and x is not None: - self._win.move(y, x) + self.move(y, x) next_attr_char = text.find('\x19') while next_attr_char != -1: if next_attr_char + 1 < len(text): |