Note
This documentation is for a development version of IPython. There may be significant differences from the latest stable release (1.2.1).
Inputhook management for GUI event loop integration.
Bases: object
Manage PyOS_InputHook for different GUI toolkits.
This class installs various hooks under PyOSInputHook to handle GUI event loop integration.
Clear IPython’s internal reference to an application instance.
Whenever we create an app for a user on qt4 or wx, we hold a reference to the app. This is needed because in some cases bad things can happen if a user doesn’t hold a reference themselves. This method is provided to clear the references we are holding.
Parameters: | gui : None or str
|
---|
Set PyOS_InputHook to NULL and return the previous one.
Parameters: | app : optional, ignored
|
---|
Return a string indicating the currently active GUI or None.
Disable event loop integration with glut.
This sets PyOS_InputHook to NULL and set the display function to a dummy one and set the timer to a dummy timer that will be triggered very far in the future.
Disable event loop integration with PyGTK.
This merely sets PyOS_InputHook to NULL.
Disable event loop integration with PyGTK.
This merely sets PyOS_InputHook to NULL.
Disable event loop integration with pyglet.
This merely sets PyOS_InputHook to NULL.
Disable event loop integration with PyQt4.
This merely sets PyOS_InputHook to NULL.
Disable event loop integration with Tkinter.
This merely sets PyOS_InputHook to NULL.
Disable event loop integration with wxPython.
This merely sets PyOS_InputHook to NULL.
Enable event loop integration with GLUT.
Parameters: | app : ignored
|
---|
Notes
This methods sets the PyOS_InputHook for GLUT, which allows the GLUT to integrate with terminal based applications like IPython. Due to GLUT limitations, it is currently not possible to start the event loop without first creating a window. You should thus not create another window but use instead the created one. See ‘gui-glut.py’ in the docs/examples/lib directory.
The default screen mode is set to: glut.GLUT_DOUBLE | glut.GLUT_RGBA | glut.GLUT_DEPTH
Enable event loop integration with PyGTK.
Parameters: | app : ignored
|
---|
Notes
This methods sets the PyOS_InputHook for PyGTK, which allows the PyGTK to integrate with terminal based applications like IPython.
Enable event loop integration with Gtk3 (gir bindings).
Parameters: | app : ignored
|
---|
Notes
This methods sets the PyOS_InputHook for Gtk3, which allows the Gtk3 to integrate with terminal based applications like IPython.
Enable event loop integration with pyglet.
Parameters: | app : ignored
|
---|
Notes
This methods sets the PyOS_InputHook for pyglet, which allows pyglet to integrate with terminal based applications like IPython.
Enable event loop integration with PyQt4.
Parameters: | app : Qt Application, optional.
|
---|
Notes
This methods sets the PyOS_InputHook for PyQt4, which allows the PyQt4 to integrate with terminal based applications like IPython.
If app is not given we probe for an existing one, and return it if found. If no existing app is found, we create an QApplication as follows:
from PyQt4 import QtCore
app = QtGui.QApplication(sys.argv)
Enable event loop integration with Tk.
Parameters: | app : toplevel Tkinter.Tk widget, optional.
|
---|
Notes
If you have already created a Tkinter.Tk object, the only thing done by this method is to register with the InputHookManager, since creating that object automatically sets PyOS_InputHook.
Enable event loop integration with wxPython.
Parameters: | app : WX Application, optional.
|
---|
Notes
This methods sets the PyOS_InputHook for wxPython, which allows the wxPython to integrate with terminal based applications like IPython.
If app is not given we probe for an existing one, and return it if found. If no existing app is found, we create an wx.App as follows:
import wx
app = wx.App(redirect=False, clearSigInt=False)
Return the current PyOS_InputHook as a ctypes.c_void_p.
Return the current PyOS_InputHook as a ctypes.PYFUNCYPE.
Set PyOS_InputHook to callback and return the previous one.
Switch amongst GUI input hooks by name.
This is just a utility wrapper around the methods of the InputHookManager object.
Parameters: | gui : optional, string or None
app : optional, existing application object.
|
---|---|
Returns: | The output of the underlying gui switch routine, typically the actual PyOS_InputHook wrapper object or the GUI toolkit app created, if there was one. |