{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%gui qt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n# More complex grid layout\n\n::\n\n +---+-------+---+\n | 1 | 1 | 2 |\n |---+-------+---+\n | 3 | Empty | 2 |\n +---+-------+---+\n | 3 | 4 | 4 |\n +---+-------+---+\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import sys\n\nfrom vispy import scene, app\n\ncanvas = scene.SceneCanvas(keys='interactive')\ncanvas.size = 600, 600\ncanvas.bgcolor = \"#000000\"\ncanvas.show()\n\ngrid = canvas.central_widget.add_grid()\n\n# top_left\ngrid.add_widget(row=0, col=0, col_span=2, bgcolor=\"#ffffff\")\n\n# top_right\ngrid.add_widget(row=0, col=2, row_span=2, bgcolor=\"#dddddd\")\n\n# bottom_left\ngrid.add_widget(row=1, col=0, row_span=2, bgcolor=\"#444444\")\n\n\n# bottom_right\ngrid.add_widget(row=2, col=1, col_span=2, bgcolor=\"#888888\")\n\n\nif __name__ == '__main__' and sys.flags.interactive == 0:\n app.run()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.19" } }, "nbformat": 4, "nbformat_minor": 0 }