From 5251f278e83f2da90a025453b7a6d97513325832 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 26 Jul 2013 04:19:41 +0200 Subject: [PATCH] try.. except wrapper for ncurses.set_curs --- gui/gui_text.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gui/gui_text.py b/gui/gui_text.py index 766c0836c..3fd022994 100644 --- a/gui/gui_text.py +++ b/gui/gui_text.py @@ -21,7 +21,7 @@ class ElectrumGui: self.stdscr.keypad(1) self.stdscr.border(0) self.maxy, self.maxx = self.stdscr.getmaxyx() - curses.curs_set(0) + self.set_cursor(0) self.w = curses.newwin(10, 50, 5, 5) self.wallet = wallet @@ -44,6 +44,12 @@ class ElectrumGui: self.num_tabs = len(self.tab_names) + def set_cursor(self, x): + try: + curses.curs_set(x) + except: + pass + def restore_or_create(self): pass @@ -51,12 +57,12 @@ class ElectrumGui: pass def get_string(self, y, x): - curses.curs_set(1) + self.set_cursor(1) curses.echo() self.stdscr.addstr( y, x, " "*20, curses.A_REVERSE) s = self.stdscr.getstr(y,x) curses.noecho() - curses.curs_set(0) + self.set_cursor(0) return s