Implements the global singleton app object.
Representation of the vispy application
This wraps a native GUI application instance. Vispy has a default
instance of this class that can be created/obtained via
The name of the backend application to use. If not specified,
Vispy tries to select a backend automatically. See vispy.use()
Upon creating an Application object, a backend is selected, but the
native backend application object is only created when create()
is called or native is used. The Canvas and Timer do this
The module object that defines the backend.
The name of the GUI backend that this app wraps.
Create the native application.
Determine if the user requested interactive mode.
Determine if the user is executing in a Jupyter Notebook
The native GUI application instance.
Process all pending GUI events. If the mainloop is not
running, this should be done regularly to keep the visualization
interactive and to keep the event system going.
Quit the native GUI event loop.
Called when the application is reused in an interactive session.
This allow the backend to do stuff in the client when use_app() is
called multiple times by the user. For example, the notebook backends
Enter the native GUI event loop.
Is the application allowed to handle interactive mode for console
terminals? By default, typing python -i main.py results in
an interactive shell that also regularly calls the VisPy event
loop. In this specific case, the run() function will terminate
immediately and rely on the interpreter’s input loop to be run
after script execution.
python -i main.py
Sleep for the given duration in seconds.
This is used to reduce
CPU stress when VisPy is run in interactive mode.
see inputhook.py for details
Time to sleep in seconds