##// END OF EJS Templates
inputhook: use '%gui none' for disabling the input hook.
Christian Boos -
Show More
@@ -32,6 +32,7 b" GUI_TK = 'tk'"
32 GUI_OSX = 'osx'
32 GUI_OSX = 'osx'
33 GUI_GLUT = 'glut'
33 GUI_GLUT = 'glut'
34 GUI_PYGLET = 'pyglet'
34 GUI_PYGLET = 'pyglet'
35 GUI_NONE = 'none' # i.e. disable
35
36
36 #-----------------------------------------------------------------------------
37 #-----------------------------------------------------------------------------
37 # Utilities
38 # Utilities
@@ -417,8 +418,8 b' def enable_gui(gui=None, app=None):'
417 Parameters
418 Parameters
418 ----------
419 ----------
419 gui : optional, string or None
420 gui : optional, string or None
420 If None, clears input hook, otherwise it must be one of the recognized
421 If None (or 'none'), clears input hook, otherwise it must be one
421 GUI names (see ``GUI_*`` constants in module).
422 of the recognized GUI names (see ``GUI_*`` constants in module).
422
423
423 app : optional, existing application object.
424 app : optional, existing application object.
424 For toolkits that have the concept of a global app, you can supply an
425 For toolkits that have the concept of a global app, you can supply an
@@ -433,6 +434,7 b' def enable_gui(gui=None, app=None):'
433 one.
434 one.
434 """
435 """
435 guis = {None: clear_inputhook,
436 guis = {None: clear_inputhook,
437 GUI_NONE: clear_inputhook,
436 GUI_OSX: lambda app=False: None,
438 GUI_OSX: lambda app=False: None,
437 GUI_TK: enable_tk,
439 GUI_TK: enable_tk,
438 GUI_GTK: enable_gtk,
440 GUI_GTK: enable_gtk,
@@ -90,8 +90,11 b' def create_inputhook_qt4(mgr, app=None):'
90 except KeyboardInterrupt:
90 except KeyboardInterrupt:
91 got_kbdint[0] = True
91 got_kbdint[0] = True
92 mgr.clear_inputhook()
92 mgr.clear_inputhook()
93 print("\n(event loop interrupted - "
93 print("\nKeyboardInterrupt - qt4 event loop interrupted!"
94 "hit CTRL+C again to clear the prompt)")
94 "\n * hit CTRL+C again to clear the prompt"
95 "\n * use '%gui none' to disable the event loop"
96 " permanently"
97 "\n and '%gui qt4' to re-enable it later")
95 return 0
98 return 0
96
99
97 def preprompthook_qt4(ishell):
100 def preprompthook_qt4(ishell):
General Comments 0
You need to be logged in to leave comments. Login now