Implements the global singleton app object.
- class vispy.app.application.Application(backend_name=None)¶
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().
- backend_namestr | None
The name of the backend application to use. If not specified, Vispy tries to select a backend automatically. See
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.
- property backend_module¶
The module object that defines the backend.
- property backend_name¶
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
- property native¶
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.
Enter the native GUI event loop.
Is the application allowed to handle interactive mode for console terminals? By default, typing
python -i main.pyresults 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.
Sleep for the given duration in seconds.
This is used to reduce CPU stress when VisPy is run in interactive mode.
- duration_sec: float
Time to sleep in seconds