Implements the global singleton app object.
vispy.app.application.
Application
Bases: object
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 vispy.app.use_app().
The name of the backend application to use. If not specified, Vispy tries to select a backend automatically. See vispy.use() for details.
vispy.use()
Notes
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 automatically.
backend_module
The module object that defines the backend.
backend_name
The name of the GUI backend that this app wraps.
create
Create the native application.
is_interactive
Determine if the user requested interactive mode.
is_notebook
Determine if the user is executing in a Jupyter Notebook
native
The native GUI application instance.
process_events
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
Quit the native GUI event loop.
reuse
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 need to inject JavaScript code as soon as use_app() is called.
run
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
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