summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEevee (Alex Munroe) <eevee.git@veekun.com>2014-06-03 19:47:00 -0700
committerEevee (Alex Munroe) <eevee.git@veekun.com>2014-06-03 19:47:00 -0700
commit0761c961963b7deb3256bfdafb1b7664f9f80be3 (patch)
tree9600bba1f4e8c8c50312c72f65c2e98bf31c3c4d
parent5386dd6e283464ef492a6ce70fed0074f48719ae (diff)
downloadurwid-0761c961963b7deb3256bfdafb1b7664f9f80be3.tar.gz
MainLoop.start/stop now start/stop the screen, too.
-rwxr-xr-xurwid/main_loop.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/urwid/main_loop.py b/urwid/main_loop.py
index 967596d..613f5c4 100755
--- a/urwid/main_loop.py
+++ b/urwid/main_loop.py
@@ -275,8 +275,7 @@ class MainLoop(object):
and :meth:`stop` once it's finished.
"""
try:
- with self.screen.start():
- self._run()
+ self._run()
except ExitMainLoop:
pass
@@ -327,6 +326,8 @@ class MainLoop(object):
Twisted and asyncio loops won't stop automatically when
:exc:`ExitMainLoop` (or anything else) is raised.
"""
+ self.screen.start()
+
if self.handle_mouse:
self.screen.set_mouse_tracking()
@@ -356,6 +357,8 @@ class MainLoop(object):
self._reset_input_descriptors)
self.screen.unhook_event_loop(self.event_loop)
+ self.screen.stop()
+
def _reset_input_descriptors(self):
self.screen.unhook_event_loop(self.event_loop)
self.screen.hook_event_loop(self.event_loop, self._update)