.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/gui_auto.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_gui_auto.py: GUI Auto -------- Run the triangle example in an automatically selected GUI backend. The rendercanvas automatically selects one of its available GUI backends. E.g. running this in a notebook will use the Jupyter backend. If the Qt event loop is running, it will use the Qt backend. The default backend uses glfw. See https://rendercanvas.readthedocs.io/stable/backends.html for more info, and https://rendercanvas.readthedocs.io/stable/gallery/index.html for examples with various GUI's and event loops. .. GENERATED FROM PYTHON SOURCE LINES 18-40 .. code-block:: Python # test_example = true from rendercanvas.auto import RenderCanvas, loop try: from .triangle import setup_drawing_sync except ImportError: from triangle import setup_drawing_sync canvas = RenderCanvas(title="Cube example on $backend") draw_frame = setup_drawing_sync(canvas.get_wgpu_context()) @canvas.request_draw def animate(): draw_frame() canvas.request_draw() if __name__ == "__main__": loop.run() .. _sphx_glr_download_gallery_gui_auto.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: gui_auto.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: gui_auto.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: gui_auto.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_