commit 5251f278e83f2da90a025453b7a6d97513325832
parent 9ce90932ba6ca7f474f1d7bbae08bffaf28d842e
Author: ThomasV <thomasv@gitorious>
Date: Fri, 26 Jul 2013 04:19:41 +0200
try.. except wrapper for ncurses.set_curs
Diffstat:
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git 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