Commit 9d2d5e52 authored by Fjen Undso's avatar Fjen Undso
Browse files

quit properly if window too small

parent 98cef37e
......@@ -39,7 +39,10 @@ class NCHL:
curses.init_pair(curses.COLOR_WHITE, 0, curses.COLOR_WHITE)
curses.init_pair(curses.COLOR_YELLOW, curses.COLOR_YELLOW, -1)
self.setup_screen()
try:
self.setup_screen()
except curses.error:
quit("Window too small to draw")
def setup_screen(self):
self.screen.clear()
......@@ -176,7 +179,10 @@ class NCHL:
self.strips[e.name].set_all(color)
self.strips[e.name].send()
if k == "KEY_RESIZE":
self.setup_screen()
try:
self.setup_screen()
except curses.error:
quit("Window too small to draw")
def main(stdscr):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment