{"id":1009,"date":"2018-08-07T18:29:33","date_gmt":"2018-08-07T16:29:33","guid":{"rendered":"http:\/\/pythonprogramming.altervista.org\/?p=1009"},"modified":"2018-08-27T07:54:06","modified_gmt":"2018-08-27T05:54:06","slug":"gui-zero","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/gui-zero\/","title":{"rendered":"GUI zero (compared to tkinter)"},"content":{"rendered":"<h2>Welcome to GUI zero, a new way to use tkinter<\/h2>\n<p><a href=\"http:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/08\/COVER.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-1020\" src=\"http:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/08\/COVER.png\" alt=\"\" width=\"601\" height=\"335\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/08\/COVER.png 969w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/08\/COVER-320x178.png 320w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/08\/COVER-768x427.png 768w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/08\/COVER-960x534.png 960w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/a><\/p>\n<p>Why don&#8217;t we have another approach to GUI with python. Instead of using tkinter we could use GUI zero.<\/p>\n<p>Install the module with<\/p>\n<blockquote><p>pip install guizero<\/p><\/blockquote>\n<h2>Starting a window<\/h2>\n<p>It is very simple to start a window with guizero:<\/p>\n<pre class=\"lang:default decode:true\"># Create a window with a title\r\n\r\nfrom guizero import App\r\napp = App(title=\"Hello world\")\r\napp.display()<\/pre>\n<p>As you can see, the syntax is easier than the one that you use with tkinter:<\/p>\n<pre class=\"lang:default decode:true\">#\r\nfrom tkinter import *\r\n\r\nroot = Tk()\r\nroot.title(\"Hello World!\")\r\n\r\nroot.mainloop()<\/pre>\n<p>&#8230; but not so different. We have App() instead of Tk(), and display, instead of mainloop at the end.<\/p>\n<h2>Text and Buttons<\/h2>\n<p>What we call Label in tkinter, here is simply text, while Button is PushButton. As argument, we have the parent widget and then text and command as usual. The command argument takes the name of the function that will be called when the button is pushed. In this cas, when the button is pushed we go to the action function that will\u00a0 change the text of textshow widget into &#8220;I know, you clicked&#8221;.<\/p>\n<pre class=\"lang:default decode:true\">from guizero import App, Text, PushButton\r\n\r\n# Method to call when button pressed\r\n\r\n# Set up the app\r\napp = App(\"First example of Gui Zero\")\r\n\r\n\r\ndef action():\r\n    textshow.value = \"I know, you clicked!\"\r\n\r\n\r\ndef line():\r\n    Text(app, \"--------------------\")\r\n\r\n\r\ntext = Text(app, \"Python GUI\")\r\n\r\nline()\r\n\r\nbutton = PushButton(app, action, text=\"Click to start the action\")\r\n\r\nline()\r\n\r\ntextshow = Text(app, text=\"?\", color=\"red\")\r\n\r\nline()\r\n\r\napp.display()<\/pre>\n<p><a href=\"http:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/08\/guizero1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1010\" src=\"http:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/08\/guizero1.png\" alt=\"\" width=\"506\" height=\"285\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/08\/guizero1.png 506w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/08\/guizero1-320x180.png 320w\" sizes=\"auto, (max-width: 506px) 100vw, 506px\" \/><\/a><\/p>\n<h2>Create a second window<\/h2>\n<pre class=\"lang:default decode:true \">from guizero import App, Window\r\n\r\napp = App(title=\"Main window\")\r\nwindow = Window(app, title=\"2nd window\")\r\n\r\napp.display()<\/pre>\n<h2>Opening and closing windows is easy<\/h2>\n<pre class=\"lang:default decode:true \">from guizero import App, Window\r\n\r\ndef open_window():\r\n    window.show()\r\n\r\ndef close_window():\r\n    window.hide()\r\n\r\napp = App(title=\"Main window\")\r\n\r\nwindow = Window(app, title=\"2nd window\")\r\nwindow.hide()\r\n\r\nopen_button = PushButton(app, text=\"Open\", command=open_window)\r\nclose_button = PushButton(window, text=\"Close\", command=close_window)\r\n\r\napp.display()<\/pre>\n<h2>Open a window preventing from using the other<\/h2>\n<pre class=\"lang:default decode:true \">def open_window():\r\n    window.show(wait=True)<\/pre>\n<h2>Grid to position widgets<\/h2>\n<pre class=\"lang:default decode:true \">app = App(layout=\"grid\")\r\ntext = Text(app, text=\"Hello world\", grid=[0,1])<\/pre>\n<p>Example<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/lawsie.github.io\/guizero\/images\/keypad_windows.png\" alt=\"App title\" \/><\/p>\n<pre class=\"lang:default decode:true\">from guizero import App, PushButton\r\ndef do_nothing():\r\n    print(\"Nothing happened\")\r\n\r\napp = App(title=\"Keypad example\", width=100, height=90, layout=\"grid\")\r\nbutton1 = PushButton(app, command=do_nothing, text=\"1\", grid=[0,0])\r\nbutton2 = PushButton(app, command=do_nothing, text=\"2\", grid=[1,0])\r\nbutton3  = PushButton(app, command=do_nothing, text=\"3\", grid=[2,0])\r\nbutton4  = PushButton(app, command=do_nothing, text=\"4\", grid=[0,1])\r\nbutton5  = PushButton(app, command=do_nothing, text=\"5\", grid=[1,1])\r\nbutton6  = PushButton(app, command=do_nothing, text=\"6\", grid=[2,1])\r\napp.display()<\/pre>\n<h2>Span Text<\/h2>\n<figure id=\"attachment_1018\" aria-describedby=\"caption-attachment-1018\" style=\"width: 630px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/08\/span1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1018 size-full\" src=\"http:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/08\/span1.png\" alt=\"\" width=\"630\" height=\"184\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/08\/span1.png 630w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/08\/span1-320x93.png 320w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/a><figcaption id=\"caption-attachment-1018\" class=\"wp-caption-text\">span text in two column with grid layout<\/figcaption><\/figure>\n<pre class=\"lang:default decode:true\">from guizero import App, Text\r\n\r\napp = App(\"Span text\", layout=\"grid\")\r\n\r\ntext = Text(app, text=\"column_x=0 row_y=0\", bg=\"yellow\", grid=[0,0,])\r\ntext2 = Text(app, text=\"column_x=1 row_y=0\", bg=\"red\", grid=[1,0])\r\ntext3 = Text(app, text=\"column_x=2 row_y=0\", grid=[2,0])\r\n\r\napp.display()<\/pre>\n<h2>Span images<\/h2>\n<pre class=\"lang:default decode:true \">from guizero import App, Picture\r\n\r\napp = App(title=\"guizero grid span example\", width=460, height=210, layout=\"grid\")\r\npicture1 = Picture(app, image=\"std1.gif\", grid=[0,0])\r\npicture2 = Picture(app, image=\"std2.gif\", grid=[1,0])\r\npicture3 = Picture(app, image=\"tall1.gif\", grid=[2,0,1,2])\r\npicture4 = Picture(app, image=\"wide1.gif\", grid=[0,1,2,1])\r\n\r\napp.display()<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/lawsie.github.io\/guizero\/images\/grid_images_rpi.png\" alt=\"Grid layout images\" \/><\/p>\n<h2>Warning box<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/lawsie.github.io\/guizero\/images\/warning_windows.png\" alt=\"Warning popup\" \/><\/p>\n<pre class=\"lang:default decode:true \">from guizero import App, warn\r\napp = App(title=\"Biscuit monitor\")\r\nwarn(\"Uh oh!\", \"You are almost out of biscuits!\")\r\napp.display()<\/pre>\n<h2>Yes no box<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/lawsie.github.io\/guizero\/images\/yesno_windows.png\" alt=\"Yes No popup\" \/><\/p>\n<pre class=\"lang:default decode:true \">from guizero import App, yesno, info, error\r\napp = App(title=\"Snowman\")\r\nbuild_a_snowman = yesno(\"A question...\", \"Do you want to build a snowman?\")\r\nif build_a_snowman == True:\r\n    info(\"Snowman\", \"It doesn't have to be a snowman\")\r\nelse:\r\n    error(\"Snowman\", \"Okay bye...\")\r\napp.display()<\/pre>\n<h2>PushButton that pops info<\/h2>\n<pre class=\"lang:default decode:true \">from guizero import App, PushButton, info\r\napp = App()\r\nbutton = PushButton(app, command=info, args=[\"Info\", \"You pressed the button\"])\r\napp.display()<\/pre>\n<h2>Do you really want to close?(.on_close method of App)<\/h2>\n<pre class=\"lang:default decode:true \">from guizero import App, Text, yesno\r\n\r\n# Ask the user if they really want to close the window\r\ndef do_this_on_close():\r\n    if yesno(\"Close\", \"Do you want to quit?\"):\r\n        app.destroy()\r\n\r\napp = App()\r\n\r\ntitle = Text(app, text=\"blank app\")\r\n\r\n# When the user tries to close the window, run the function do_this_on_close()\r\napp.on_close(do_this_on_close)\r\n\r\napp.display()<\/pre>\n<h2>The rest of the documentation<\/h2>\n<p>This examples are based on the documentation of gui zero site. To read the rest of the documentation go here:<\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/size\/\">The size of the widgets<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/colors\/\">Colors<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/images\/\">Images<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/blocking\/\">Loops and sleeping<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/events\/\">events<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/usingtk\/\">Using tkinter methods<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/resources\/\">Examples and resources<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/recipes\/\">Recipes<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/app\/\">App<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/box\/\">Box<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/buttongroup\/\">ButtonGroup<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/checkbox\/\">CheckBox<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/combo\/\">Combo<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/listbox\/\">ListBox<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/menubar\/\">MenuBar<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/picture\/\">Picture<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/pushbutton\/\">PushButton<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/slider\/\">Slider<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/text\/\">Text<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/textbox\/\">TextBox<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/waffle\/\">Waffle<\/a><\/p>\n<p><a href=\"https:\/\/lawsie.github.io\/guizero\/waffle\/\">Window<\/a><\/p>\n<p>&nbsp;<\/p>\n\t<!----- pubblicit\u00e0-------- vedi h:\\ads\\codice_di_prima.txt per il codice che era qui --------------------->\r\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- Altervista-pythonprogramming-336X280 -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-4189782812829764\"\r\n     data-ad-slot=\"2548661001\"\r\n     data-ad-format=\"auto\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\r\n<h4>Tkinter test for students<\/h4>\r\n\r\n\r\n<script>\r\nvar title = \"Tkinter posts\";\r\n\t\tvar links = [\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-app-to-make-a-different-test-for-every-student-part-1\/\",\"Tk Test Marker I\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-testmaker-part-ii\/\",\"Tk Test Maker II\"],\t\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-tests-app-part-3\/\",\"Tk test Maker III\"]\r\n];\r\n\t\t\r\n\t<\/script>\r\n<script>\r\n\t\r\nif (typeof next2 != \"undefined\"){let next2 = 0;}\r\n\t\r\nnext2 = 0;\r\n\thtml = \"\";\/\/<b style='color:coral;font-size:1.2em'>Other posts about \" + title + \"<\/b><br>\";\r\nfor (address of links) \r\n{\r\n\r\n\tif (next2 == 1){\r\n\t\thtml += \"<div style='background:coral'>\";\r\n\t\thtml += \"Next link => <a href='\" + address[0] + \"'>\" + address[1] + \"<\/a>\";\r\n\t\thtml += \"<\/div><br>\";\r\n\t\tnext2 = 0;\r\n\t}\r\n\tif (address[0] == document.URL) {\r\n\t\tnext2 = 1;\r\n\t}\r\n}\r\n\r\nif (typeof next != \"undefined\") {let next = 0;}\r\nif (typeof addressStart != \"undefined\") {let addressStart = \"\";}\r\nnext = 0;\r\naddressStart = \"<a href='\";\r\nfor (address of links) {\r\n\tif (next == 1){\r\n\t\thtml += \">>>\" + addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t\tnext = 0;\r\n\t}\r\n\telse if (addressStart + address[0] != document.URL)\r\n\t{\r\n\t\thtml += addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tnext = 1;\r\n\t\tnext_address = address[0]\r\n\t\tnext_title = address[1]\r\n\t\thtml += \"<span style='color:gray'>\" + address[1] + \"<\/span><br>\";\r\n\t}\r\n\r\n}\r\n\r\n\thtml += `<span style=\"font-size:8px\">Powered by <a href=\"https:\/\/pythonprogramming.altervista.org\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2673\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png\" alt=\"\" width=\"70\" height=\"25\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png 156w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2-150x56.png 150w\" sizes=\"auto, (max-width: 70px) 100vw, 70px\" \/>pythonprogramming.altervista.org<\/a><\/span>`\r\n\thtml = \"<div style='background:yellow'>\" + html + \"<\/div>\";\r\n\tdocument.write(html)\r\n<\/script>\r\n\t\r\n\r\n<h4>Tkinter articles<\/h4>\r\n<!-- calculator with memo -->\r\n<a href=\"https:\/\/pythonprogramming.altervista.org\/free-calculator-memo-with-tkinter-support-markdown-to-html-saving-too\/\">\r\n<img decoding=\"async\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2020\/03\/calcmemopy_banner.png\" width=\"100%\"><\/a>\r\n<script>\r\nvar title = \"Tkinter posts\";\r\n\t\tvar links = [\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/?p=5719&preview=true\",\"Presentation app with SVG files\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/png-joined-in-one-pdf-files\/\",\"Join png into pdf\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/free-app-imgslide-3-1-slide-images-and-join-them-into-a-pdf\/\",\"ImageSlider 3.1\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-to-show-svg-files-svgslider-1-0\/\",\"SVGSlider 1.0\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/imageslider-3-0-tkinter-app-to-show-images-like-in-a-presentation\/\",\"ImageSlider 3.0\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-shows-an-svg-file\/\",\"SVG in tkinter\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-tests-maker-app-part-iv-add-a-menu-with-tkinter\/\",\"Add a menu with tkinter\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/free-pdf-maker-app-with-python\/\",\"tkinter make pdf\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/calcpy-2-0-the-second-and-final-part-of-calculator\/\",\"Live coding Calculator app part 2\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/split-every-page-in-a-pdf-i-a-different-pdf\/\",\"Split a pdf in different files\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/python-calculator-from-skratch-part-1-calcpy\/\",\"Calculator from skratch p.1\"], \r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/python-and-tkinter-fully-working-listbox-to-do-app-for-skratch\/\",\"Tkinter ToDo App\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/copy-and-paste-tkinter-widget-code-app\/\",\"Copy and paste app for tkinter widgets\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/calcdoc-py-a-tkinter-app-to-memorize-operations\/\",\"calcdoc.py: a great calculator memo app\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-calculator-with-memo-of-operations\/\",\"Calculator + list of operations\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-smallest-calculator-ever\/\", \"Smallest calculator\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/python-gui-with-tkinter-labels-with-text-and-images\/\",\"Labels with images and text\"],\r\n\t[\"https:\/\/pythonprogramming.altervista.org\/a-toolbar-for-python-with-tkinter\/\",\"Toolbar in tkinter\"],\r\n\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-grid-system-how-to-expand-a-button\/\",\"Fit Buttons to the Window\"],\r\n\t\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-application-launcher-python-gui\/\",\"Tkinter app Laucher\"],\r\n\t\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-and-how-to-add-an-image-to-a-button\/\", \"Image on a tkinter Button\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-imagebrowser-2-with-canvas\/\", \"Tkinter image browser 2 (canvas)\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-image-broswer\/\",\"Tkinter image browser (label)\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-to-make-pdf-fast-and-free-with-text-or-html\/\",\"Create PDF with Tkinter Text widget\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-app-to-evaluate-tests-part-1\/\",\"Tkinter App to Evaluate tests\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/simple-presentation-in-pure-python-while-you-learn-tkinter\/\",\"Presentation with Python\/tkinter\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-entry-widgets-example-make-a-shuffler-app\/\",\"Tkinter example: entry to shuffle lists\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/move-a-rectangle-with-text-inside-of-it-with-tkinter\/\",\"Moving a text with tkinter\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-and-ttk-the-option-menu-widget\/\",\"Tkinter's OptionMenu (and ttk)\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-app-to-watch-videos-with-live-coding\/\",\t\t\t\t\t\"Tkinter to watch videos\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/type-reader-app-in-python-pc-read-the-letters-you-type-tkinter\/\",\t\"Type Reader App\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/create-a-new-tkinter-widget-inputbox\/\",\t\t\t\t\t\t\t\"Create your Inputbox\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-open-a-new-window-and-just-one\/\", \t\t\t\t\t\t\"Open only one more window\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/a-simple-test-maker-with-python-and-tkinter\/\", \t\t\t\t\t\"Test maker with tkinter\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/my-personal-notepad-toggle-tkinter-fullscreen\/\",\t\t\t\t\t\"Ebook maker with tkinter\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-and-listbox-1\/\", \t\t\t\t\t\t\t\t\t\t\t\"Tkinter & listbox 2019 - 1\"],\r\n['https:\/\/pythonprogramming.altervista.org\/tkinter-using-a-gui-graphic-user-interface-with-python-part-1\/', \t'Create a window'],\r\n['https:\/\/pythonprogramming.altervista.org\/tkinter-to-make-a-window-video-1\/', \t\t\t\t\t\t\t\t'Create a window part 2'],\r\n[\"https:\/\/pythonprogramming.altervista.org\/create-more-windows-with-tkinter\/\",\t\t\t\t\t\t\t\t\"More windows tkinter!\"],\r\n['https:\/\/pythonprogramming.altervista.org\/tkinter-part-2-binding\/', \t\t\t\t\t\t\t\t\t\t'Binding functions to key\/button '],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/all-tkinter-posts\/\",\">>>ALL TKINTER POSTS>>>\"]\r\n\t\t];\r\n\t\t\r\n\t<\/script>\r\n<script>\r\n\t\r\nif (typeof next2 != \"undefined\"){let next2 = 0;}\r\n\t\r\nnext2 = 0;\r\n\thtml = \"\";\/\/<b style='color:coral;font-size:1.2em'>Other posts about \" + title + \"<\/b><br>\";\r\nfor (address of links) \r\n{\r\n\r\n\tif (next2 == 1){\r\n\t\thtml += \"<div style='background:coral'>\";\r\n\t\thtml += \"Next link => <a href='\" + address[0] + \"'>\" + address[1] + \"<\/a>\";\r\n\t\thtml += \"<\/div><br>\";\r\n\t\tnext2 = 0;\r\n\t}\r\n\tif (address[0] == document.URL) {\r\n\t\tnext2 = 1;\r\n\t}\r\n}\r\n\r\nif (typeof next != \"undefined\") {let next = 0;}\r\nif (typeof addressStart != \"undefined\") {let addressStart = \"\";}\r\nnext = 0;\r\naddressStart = \"<a href='\";\r\nfor (address of links) {\r\n\tif (next == 1){\r\n\t\thtml += \">>>\" + addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t\tnext = 0;\r\n\t}\r\n\telse if (addressStart + address[0] != document.URL)\r\n\t{\r\n\t\thtml += addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tnext = 1;\r\n\t\tnext_address = address[0]\r\n\t\tnext_title = address[1]\r\n\t\thtml += \"<span style='color:gray'>\" + address[1] + \"<\/span><br>\";\r\n\t}\r\n\r\n}\r\n\r\n\thtml += `<span style=\"font-size:8px\">Powered by <a href=\"https:\/\/pythonprogramming.altervista.org\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2673\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png\" alt=\"\" width=\"70\" height=\"25\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png 156w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2-150x56.png 150w\" sizes=\"auto, (max-width: 70px) 100vw, 70px\" \/>pythonprogramming.altervista.org<\/a><\/span>`\r\n\thtml = \"<div style='background:yellow'>\" + html + \"<\/div>\";\r\n\tdocument.write(html)\r\n<\/script>\n","protected":false},"excerpt":{"rendered":"Another way to make a GUI with tkinter\n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/gui-zero\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":1020,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[122,49],"tags":[52,51],"class_list":["post-1009","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gui","category-tkinter","tag-gui","tag-tkinter"],"avopt_banners_inside_post":true,"avopt_banners_on_page":true,"av_copy_from":"","av_sharing_message":"","av_sharing_allowed":false,"av_sharing_on":{"fb":[],"tw":[]},"av_allow_affiliate_banner":false,"av_allow_affiliate_multi_banner":false,"av_show_affiliation_buy_button":false,"av_post_rating":true,"av_have_post_rating_value":false,"av_is_artificial_intelligence_content":false,"_links":{"self":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/1009","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/comments?post=1009"}],"version-history":[{"count":9,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/1009\/revisions"}],"predecessor-version":[{"id":1012,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/1009\/revisions\/1012"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media\/1020"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=1009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=1009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=1009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}