##// END OF EJS Templates
Use appnope in qt and wx gui support from the terminal; closes #6189...
Eric Firing -
Show More
@@ -211,7 +211,9 b' class InputHookManager(object):'
211 raise ValueError("requires wxPython >= 2.8, but you have %s" % wx.__version__)
211 raise ValueError("requires wxPython >= 2.8, but you have %s" % wx.__version__)
212
212
213 from IPython.lib.inputhookwx import inputhook_wx
213 from IPython.lib.inputhookwx import inputhook_wx
214 from IPython.external.appnope import nope
214 self.set_inputhook(inputhook_wx)
215 self.set_inputhook(inputhook_wx)
216 nope()
215 self._current_gui = GUI_WX
217 self._current_gui = GUI_WX
216 import wx
218 import wx
217 if app is None:
219 if app is None:
@@ -227,9 +229,11 b' class InputHookManager(object):'
227
229
228 This merely sets PyOS_InputHook to NULL.
230 This merely sets PyOS_InputHook to NULL.
229 """
231 """
232 from IPython.external.appnope import nap
230 if GUI_WX in self._apps:
233 if GUI_WX in self._apps:
231 self._apps[GUI_WX]._in_event_loop = False
234 self._apps[GUI_WX]._in_event_loop = False
232 self.clear_inputhook()
235 self.clear_inputhook()
236 nap()
233
237
234 def enable_qt4(self, app=None):
238 def enable_qt4(self, app=None):
235 """Enable event loop integration with PyQt4.
239 """Enable event loop integration with PyQt4.
@@ -254,8 +258,10 b' class InputHookManager(object):'
254 app = QtGui.QApplication(sys.argv)
258 app = QtGui.QApplication(sys.argv)
255 """
259 """
256 from IPython.lib.inputhookqt4 import create_inputhook_qt4
260 from IPython.lib.inputhookqt4 import create_inputhook_qt4
261 from IPython.external.appnope import nope
257 app, inputhook_qt4 = create_inputhook_qt4(self, app)
262 app, inputhook_qt4 = create_inputhook_qt4(self, app)
258 self.set_inputhook(inputhook_qt4)
263 self.set_inputhook(inputhook_qt4)
264 nope()
259
265
260 self._current_gui = GUI_QT4
266 self._current_gui = GUI_QT4
261 app._in_event_loop = True
267 app._in_event_loop = True
@@ -267,9 +273,11 b' class InputHookManager(object):'
267
273
268 This merely sets PyOS_InputHook to NULL.
274 This merely sets PyOS_InputHook to NULL.
269 """
275 """
276 from IPython.external.appnope import nap
270 if GUI_QT4 in self._apps:
277 if GUI_QT4 in self._apps:
271 self._apps[GUI_QT4]._in_event_loop = False
278 self._apps[GUI_QT4]._in_event_loop = False
272 self.clear_inputhook()
279 self.clear_inputhook()
280 nap()
273
281
274 def enable_gtk(self, app=None):
282 def enable_gtk(self, app=None):
275 """Enable event loop integration with PyGTK.
283 """Enable event loop integration with PyGTK.
General Comments 0
You need to be logged in to leave comments. Login now