##// END OF EJS Templates
Merge pull request #6321 from efiring/fix_nap_qt_wx...
Min RK -
r17668:9d6cfce2 merge
parent child Browse files
Show More
@@ -104,7 +104,7 b' class InputHookManager(object):'
104 104 This class installs various hooks under ``PyOSInputHook`` to handle
105 105 GUI event loop integration.
106 106 """
107
107
108 108 def __init__(self):
109 109 if ctypes is None:
110 110 warn("IPython GUI event loop requires ctypes, %gui will not be available")
@@ -204,14 +204,16 b' class InputHookManager(object):'
204 204 app = wx.App(redirect=False, clearSigInt=False)
205 205 """
206 206 import wx
207
207
208 208 wx_version = V(wx.__version__).version
209
209
210 210 if wx_version < [2, 8]:
211 211 raise ValueError("requires wxPython >= 2.8, but you have %s" % wx.__version__)
212
212
213 213 from IPython.lib.inputhookwx import inputhook_wx
214 from IPython.external.appnope import nope
214 215 self.set_inputhook(inputhook_wx)
216 nope()
215 217 self._current_gui = GUI_WX
216 218 import wx
217 219 if app is None:
@@ -227,13 +229,15 b' class InputHookManager(object):'
227 229
228 230 This merely sets PyOS_InputHook to NULL.
229 231 """
232 from IPython.external.appnope import nap
230 233 if GUI_WX in self._apps:
231 234 self._apps[GUI_WX]._in_event_loop = False
232 235 self.clear_inputhook()
236 nap()
233 237
234 238 def enable_qt4(self, app=None):
235 239 """Enable event loop integration with PyQt4.
236
240
237 241 Parameters
238 242 ----------
239 243 app : Qt Application, optional.
@@ -254,8 +258,10 b' class InputHookManager(object):'
254 258 app = QtGui.QApplication(sys.argv)
255 259 """
256 260 from IPython.lib.inputhookqt4 import create_inputhook_qt4
261 from IPython.external.appnope import nope
257 262 app, inputhook_qt4 = create_inputhook_qt4(self, app)
258 263 self.set_inputhook(inputhook_qt4)
264 nope()
259 265
260 266 self._current_gui = GUI_QT4
261 267 app._in_event_loop = True
@@ -267,9 +273,11 b' class InputHookManager(object):'
267 273
268 274 This merely sets PyOS_InputHook to NULL.
269 275 """
276 from IPython.external.appnope import nap
270 277 if GUI_QT4 in self._apps:
271 278 self._apps[GUI_QT4]._in_event_loop = False
272 279 self.clear_inputhook()
280 nap()
273 281
274 282 def enable_gtk(self, app=None):
275 283 """Enable event loop integration with PyGTK.
@@ -299,7 +307,7 b' class InputHookManager(object):'
299 307
300 308 def disable_gtk(self):
301 309 """Disable event loop integration with PyGTK.
302
310
303 311 This merely sets PyOS_InputHook to NULL.
304 312 """
305 313 self.clear_inputhook()
@@ -333,7 +341,7 b' class InputHookManager(object):'
333 341
334 342 def disable_tk(self):
335 343 """Disable event loop integration with Tkinter.
336
344
337 345 This merely sets PyOS_InputHook to NULL.
338 346 """
339 347 self.clear_inputhook()
@@ -359,7 +367,7 b' class InputHookManager(object):'
359 367 without first creating a window. You should thus not create another
360 368 window but use instead the created one. See 'gui-glut.py' in the
361 369 docs/examples/lib directory.
362
370
363 371 The default screen mode is set to:
364 372 glut.GLUT_DOUBLE | glut.GLUT_RGBA | glut.GLUT_DEPTH
365 373 """
@@ -393,7 +401,7 b' class InputHookManager(object):'
393 401
394 402 def disable_glut(self):
395 403 """Disable event loop integration with glut.
396
404
397 405 This sets PyOS_InputHook to NULL and set the display function to a
398 406 dummy one and set the timer to a dummy timer that will be triggered
399 407 very far in the future.
General Comments 0
You need to be logged in to leave comments. Login now