{"id":257,"date":"2019-05-03T23:47:51","date_gmt":"2019-05-03T21:47:51","guid":{"rendered":"http:\/\/www.zellot.at\/blogs\/?p=257"},"modified":"2019-05-03T23:53:08","modified_gmt":"2019-05-03T21:53:08","slug":"playing-around-with-tkinter","status":"publish","type":"post","link":"https:\/\/www.zellot.at\/blogs\/2019\/05\/03\/playing-around-with-tkinter\/","title":{"rendered":"Playing around with tkinter"},"content":{"rendered":"\n<p>A nice tool I&#8217;ve found recently using python and tkinter is <code>pygubu-designer<\/code>.  (used for a playing around with python project &#8211; <a href=\"https:\/\/github.com\/zelle7\/websocketocppgui\">https:\/\/github.com\/zelle7\/websocketocppgui)<\/a><\/p>\n\n\n\n<p>A typical gui, even the simple ones like those which are build with <code>tkinter<\/code> come to a point where it become quite cumbersome generating all the variables and\/or properties which define the elements in the gui. At least for me, it is getting confusing quite fast and you have a lot of starting and stopping the application, to see if your updates have been successful. The  <code>pygubu-designer<\/code> comes with some a simple gui which allows you to drag in th elements you need. In addition to that you can configure various things (from visual stuff up to click handler functions).<\/p>\n\n\n\n<p>You can install the package via <code>pip<\/code>(package <code>pygubu<\/code> <a href=\"https:\/\/pypi.org\/project\/pygubu\/\">https:\/\/pypi.org\/project\/pygubu\/<\/a> ), and start in the commandline with <code>pygubu-designer.<\/code>The gui looks like this:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"396\" src=\"http:\/\/www.zellot.at\/blogs\/wp-content\/uploads\/2019\/05\/screenshot_pygubu-1024x396.jpg\" alt=\"\" class=\"wp-image-258\" srcset=\"https:\/\/www.zellot.at\/blogs\/wp-content\/uploads\/2019\/05\/screenshot_pygubu-1024x396.jpg 1024w, https:\/\/www.zellot.at\/blogs\/wp-content\/uploads\/2019\/05\/screenshot_pygubu-300x116.jpg 300w, https:\/\/www.zellot.at\/blogs\/wp-content\/uploads\/2019\/05\/screenshot_pygubu-768x297.jpg 768w, https:\/\/www.zellot.at\/blogs\/wp-content\/uploads\/2019\/05\/screenshot_pygubu-650x251.jpg 650w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The left part is the configuration part and the right things you see is a preview of the app and how it will look like. The tool itself is generating an ui-file which is just a file with xml content.<\/p>\n\n\n\n<p>One thing which was a little bit confusing at the beginning: There is no way to just drop existing elements into others. e.g. drag an existing label into a frame. As a workaround you can cut the elements and paste them into the wanted containers. Another thing is that you can move elements up, down, left, right with <code>ALT + (I|K|J|L)<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A nice tool I&#8217;ve found recently using python and tkinter is pygubu-designer. (used for a playing around with python project &#8211; https:\/\/github.com\/zelle7\/websocketocppgui) A typical gui, even the simple ones like those which are build with tkinter come to a point where it become quite cumbersome generating all the variables and\/or properties which define the elements [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,96],"tags":[101,99,98,100],"class_list":["post-257","post","type-post","status-publish","format-standard","hentry","category-allgemein","category-python","tag-gui","tag-pygubu","tag-python3","tag-tkinter"],"_links":{"self":[{"href":"https:\/\/www.zellot.at\/blogs\/wp-json\/wp\/v2\/posts\/257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zellot.at\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zellot.at\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zellot.at\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zellot.at\/blogs\/wp-json\/wp\/v2\/comments?post=257"}],"version-history":[{"count":5,"href":"https:\/\/www.zellot.at\/blogs\/wp-json\/wp\/v2\/posts\/257\/revisions"}],"predecessor-version":[{"id":264,"href":"https:\/\/www.zellot.at\/blogs\/wp-json\/wp\/v2\/posts\/257\/revisions\/264"}],"wp:attachment":[{"href":"https:\/\/www.zellot.at\/blogs\/wp-json\/wp\/v2\/media?parent=257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zellot.at\/blogs\/wp-json\/wp\/v2\/categories?post=257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zellot.at\/blogs\/wp-json\/wp\/v2\/tags?post=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}