<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Segoe UI Emoji";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.gmail-
        {mso-style-name:gmail-;}
span.gmail-hoenzb
        {mso-style-name:gmail-hoenzb;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Verdana",sans-serif;
        color:#001A6C;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C">Yea, software evolves.  Things get layered on top of other things.  It’s kind of how software works.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C">Perhaps the point is getting lost here on my request to comment on the overall construct and simplicity.  Let’s try a different approach…<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C">How about a quick example that you code up in your favorite GUI?  Try and make it simple enough for a beginner to grasp as much as possible.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C">Here we go:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C">Take 3 numbers as input (A, B, C).  Add them together.  Display the result in a simple pop-up window.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C">That’s a pretty typical kind of problem for the first few weeks of beginning programming.  Maybe first few days.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C">Let’s say I want my program to look and work like other windows programs.  I want to show my friends, mom and dad that I can write software too.  In this example,
 I would expect that kind of reasoning that would drive a desire for a GUI.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C"><o:p> </o:p></span></p>
<p class="MsoNormal"><i><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C"><a href="mailto:mike_barnett@hotmail.com"><span style="color:#0563C1">@mike</span></a><o:p></o:p></span></i></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Verdana",sans-serif;color:#001A6C"><o:p> </o:p></span></p>
<p class="MsoNormal"><b>From:</b> Chris Barker <chris.barker@noaa.gov> <br>
<b>Sent:</b> Friday, August 24, 2018 1:39 PM<br>
<b>To:</b> Paul Moore <p.f.moore@gmail.com><br>
<b>Cc:</b> Mike Barnett <mike_barnett@hotmail.com>; Python-Ideas <python-ideas@python.org><br>
<b>Subject:</b> Re: [Python-ideas] A GUI for beginners and experts alike<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">A couple thoughts:<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You're essentially writing a new API on top of tkINter, you could probably have multiple "back-ends" -- i.e. be able to use the same code with wxPython or PySide behind it.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">In fact, there was an effort along these lines a few years back:<br>
<br>
<a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cosc.canterbury.ac.nz%2Fgreg.ewing%2Fpython_gui%2F&data=02%7C01%7C%7C7c6bd9bc319e45a33d8f08d609e89e3f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636707292023975025&sdata=iPZUt3MlLOPPpwAUHdYbXuV3g8iG2JSDgtzd1W9iCyc%3D&reserved=0">http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I don't know that it's seen much development lately.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<div>
<p class="MsoNormal">Nope. I don't even have a need for a canvas. But what I have found in the past is that *anything* which is a "simple wrapper over X" always ends up in a situation where you need some feature from X that the simple wrapper doesn't cover,
 and you're left with the unpalatable choice of whether to omit functionality you want to provide, or rewrite your code to use X directly. So my question is more about "if you hit a need for something PySimpleGUI doesn't cover, what are your options?<o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">This is key -- and one of the real issues around wrapping multiple GUI back-ends -- you end up having to do a lot of re-implementation of details.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">In fact, I always thought Pyton_guiu above really suffered from that conceptually. For example, if you used pyton-gui with a wxPython back end, you had:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">A python wrapper around a python wrapper around a C++ wrapper around each native toolkit.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">That's a lot of layers!<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">So it's probably better to have a simpler stack -- and at the bottom, you probably need something with at least some C/C++ in it. And there are two options there:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">1)  re-implement widgets with native basic drawing and event handling.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">  - this is what QT GTK, and TK do<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">2) Wrap the native widgets<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">  - this is what wxWidgets does<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The advantage of  (1) is that most of your code is the same on all platform, widgets behave the same on all platforms, and there is less code to write to support a new platform.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The advantage of (2) is that you get more native results -- the widgets ARE native. And it's easier to support the first platform -- you aren't writing a while GUI toolkit. But there is a lot more wrapper code to write for each new platform.
 And the results ARE going to be a bit platform-dependent in some places (though I've found that I need to write very little platform dependent code with wx)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">TK is essentially (1), though AIUI, it was originally written for X-windows, and the other platform have an X-windows emulation layer, and then all the TK code works with that.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">But the issue with TK is that it's really pretty old and krufty. It's great that it comes with the standard library, but now that yu can pip install pySide and wxPython, I'd consider working with one of those.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I'd also make sure that you CAN "drop down" into the lower level toolkit fairly smoothly, if you do need something more complex that the basics.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Finally -- I'm not sure the desktop is dead, but there is a heck of a lot going on in the browser. And if someone could write a simple GUI for a desktop app, and then easily prt that to a WebApp -- that would be great.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I'm sure there are toolkits that do maybe it possible to write pure-python, and have all the javascript pre-written (Or generated) for you. While its not a complete solution, Jupyter Widgets does this within the Jupyter framework, for instance.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">-CHB<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">3. It doesn't seem to use native widgets (the buttons have a non-standard look on my Windows PC).<br>
The defaults can be easily changed.  The default buttons are the one widget that I modify from the system default.  The reason was that the system default is a gray button.  It pretty much matches the background.<br>
<br>
If you want your buttons to all look like the system default, slip this line of code at the top:<br>
<br>
sg.SetOptions(button_color=sg.COLOR_SYSTEM_DEFAULT)<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">OK. Personally, I'd argue quite strongly that "match the OS default" is the right default for a GUI library, but that's a hugely subjective area, and you're never going to please everyone. So do whatever works for you.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Thank you again Paul... I learn something new from every reply
<span style="font-family:"Segoe UI Emoji",sans-serif">😊</span><o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">No problem - glad it helped.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888">Paul <o:p></o:p></span></p>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.python.org%2Fmailman%2Flistinfo%2Fpython-ideas&data=02%7C01%7C%7C7c6bd9bc319e45a33d8f08d609e89e3f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636707292023975025&sdata=EPc7GJIUUUGJ6WKLuHA1Pd2a0NWg7srxxB3KXxStDyo%3D&reserved=0" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpython.org%2Fpsf%2Fcodeofconduct%2F&data=02%7C01%7C%7C7c6bd9bc319e45a33d8f08d609e89e3f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636707292023975025&sdata=%2FyRXdyWNKldw3HIHuH805QoHAjedAp5CCV91cntZzpE%3D&reserved=0" target="_blank">
http://python.org/psf/codeofconduct/</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<p class="MsoNormal"><br>
Christopher Barker, Ph.D.<br>
Oceanographer<br>
<br>
Emergency Response Division<br>
NOAA/NOS/OR&R            (206) 526-6959   voice<br>
7600 Sand Point Way NE   (206) 526-6329   fax<br>
Seattle, WA  98115       (206) 526-6317   main reception<br>
<br>
<a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>