##// END OF EJS Templates
Move app caching into InputHookManager...
Thomas Kluyver -
Show More
@@ -246,7 +246,12 b' class InputHookManager(object):'
246 246 e = "Invalid GUI request {!r}, valid ones are: {}"
247 247 raise ValueError(e.format(gui, ', '.join(self.guihooks)))
248 248 self._current_gui = gui
249 return gui_hook.enable(app)
249
250 app = gui_hook.enable(app)
251 if app is not None:
252 app._in_event_loop = True
253 self.apps[gui] = app
254 return app
250 255
251 256 def disable_gui(self):
252 257 """Disable GUI event loop integration.
@@ -315,8 +320,7 b' class WxInputHook(InputHookBase):'
315 320 app = wx.GetApp()
316 321 if app is None:
317 322 app = wx.App(redirect=False, clearSigInt=False)
318 app._in_event_loop = True
319 self.manager.apps[GUI_WX] = app
323
320 324 return app
321 325
322 326 def disable(self):
@@ -357,8 +361,6 b' class Qt4InputHook(InputHookBase):'
357 361 self.manager.set_inputhook(inputhook_qt4)
358 362 nope()
359 363
360 app._in_event_loop = True
361 self.manager.apps[GUI_QT4] = app
362 364 return app
363 365
364 366 def disable_qt4(self):
@@ -483,7 +485,6 b' class GlutInputHook(InputHookBase):'
483 485 glut.glutDisplayFunc( glut_display )
484 486 glut.glutIdleFunc( glut_idle)
485 487 self.manager.set_inputhook( inputhook_glut )
486 self.manager.apps[GUI_GLUT] = True
487 488
488 489
489 490 def disable(self):
@@ -544,7 +545,6 b' class Gtk3InputHook(InputHookBase):'
544 545 """
545 546 from IPython.lib.inputhookgtk3 import inputhook_gtk3
546 547 self.manager.set_inputhook(inputhook_gtk3)
547 self.manager._current_gui = GUI_GTK
548 548
549 549
550 550 clear_inputhook = inputhook_manager.clear_inputhook
General Comments 0
You need to be logged in to leave comments. Login now