{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Property dialog\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from itom import ui\n\ngui = ui(\n \"propertyDialog.ui\",\n ui.TYPEDIALOG,\n ui.BUTTONBAR_HORIZONTAL,\n {\"AcceptRole\": \"OK\", \"RejectRole\": \"Cancel\"},\n)\n\n# pre-initialize values\ngui.spinValueA[\"value\"] = 5\ngui.spinValueB[\"value\"] = 4.5\n\n# show dialog and wait until it is closed (argument: 1 -> modal)\nret = gui.show(1)\n\nif ret == 1:\n # evaluate your input\n print(\"ValueA:\", gui.spinValueA[\"value\"])\n print(\"ValueB:\", gui.spinValueB[\"value\"])\n\n if gui.radioItem1[\"checked\"]:\n radioNr = 1\n elif gui.radioItem2[\"checked\"]:\n radioNr = 2\n else:\n radioNr = 3\n print(\"selected radio button:\", radioNr)\n\n print(\"your text:\", gui.txtText[\"text\"])\nelse:\n print(\"the dialog has been rejected\")" ] } ], "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.8.10" } }, "nbformat": 4, "nbformat_minor": 0 }