don't try to use colours if unsupported
parent
09b18e862d
commit
484981f5de
|
@ -18,7 +18,8 @@ class CursedMenu(object):
|
||||||
self.screen = curses.initscr()
|
self.screen = curses.initscr()
|
||||||
curses.noecho()
|
curses.noecho()
|
||||||
curses.raw()
|
curses.raw()
|
||||||
curses.start_color()
|
if curses.has_colors():
|
||||||
|
curses.start_color()
|
||||||
try:
|
try:
|
||||||
curses.curs_set(0)
|
curses.curs_set(0)
|
||||||
except curses.error:
|
except curses.error:
|
||||||
|
@ -35,8 +36,11 @@ class CursedMenu(object):
|
||||||
self.infotoggle = 0
|
self.infotoggle = 0
|
||||||
self.maxy, self.maxx = self.screen.getmaxyx()
|
self.maxy, self.maxx = self.screen.getmaxyx()
|
||||||
# Highlighted and Normal line definitions
|
# Highlighted and Normal line definitions
|
||||||
self.define_colors()
|
if curses.has_colors():
|
||||||
self.highlighted = curses.color_pair(1)
|
self.define_colors()
|
||||||
|
self.highlighted = curses.color_pair(1)
|
||||||
|
else:
|
||||||
|
self.highlighted = curses.A_REVERSE
|
||||||
self.normal = curses.A_NORMAL
|
self.normal = curses.A_NORMAL
|
||||||
# Threaded screen update for live changes
|
# Threaded screen update for live changes
|
||||||
screen_thread = threading.Thread(target=self.update_plant_live, args=())
|
screen_thread = threading.Thread(target=self.update_plant_live, args=())
|
||||||
|
|
Loading…
Reference in New Issue