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