From: Steven D'Aprano on
On Wed, 09 Jun 2010 04:16:23 -0700, ant wrote:


> 1 Although a few advocates of Tkinter have spoken in favour of it, most
> seem to think that:
> It's not particularly elegant, either in its use or its
> implementation with Tcl/Tk
> If we didn't have a GUI in the distribution, we wouldn't choose
> Tkinter now; it seems like its inclusion
> is a sort of historical accident.

I'm not so sure about that. If we didn't have a GUI, what would we
include? There are many alternatives, of course, but nothing that stands
out as "the" obvious choice for the standard library. It seems to me that
the odds are good that Tkinter *would* be choosen today. Particularly
since modern versions of Tk use native widgets and so look better.

It's easy to dump on Tkinter, and I've done so myself, but it's not that
bad all things considering.


[...]
> whenever I
> write a program that someone else is going to use, it has to have a
> GUI. Is that not true for most people?

No. Most Python development is for either the web or the command line.



> 5 I should stop pontificating, and write code. If it's better than the
> existing, people will use it and it will
> become the standard.
> I don't think so. Even vast libraries of well-written code haven't
> become the standard.

Not everything needs to be "the standard". I believe GUIs are like that.
The requirements and complexity of GUI toolkits are difficult enough that
having choice between three or four "world-class" toolkits (which slowly
converge on equivalent functionality, if not equivalent APIs) is a good
thing.



> So I think comments like "the system doesn't work like that - nothing
> happens till code is working" miss the point. We are not talking about
> some vital but complex module or library here - it's more important than
> that.

No, it *is* the point. This is Open Source. Code walks the walk, and
everything else is just chat. *If* you inspire somebody to take up the
challenge, then great, but otherwise this is just wasted electrons.

If writing the code is too much for you, write a PEP explaining why you
think Tkinter must go and what features you expect in the replacement. Or
do a comprehensive survey of what GUIs are available, and what it would
take to make them part of the standard library.

Even a comprehensive comparison of cost/benefits for GUI toolkits would
be a start. You might find that, when looking at what *actually* exists,
and how high the bar is even for an entry-level toolkit, Tkinter starts
looking better and better. Or not. Who knows? Until somebody does the
work, it's all just opinion, and unjustified opinion at that.


> We are talking about the thing that the rest of the world sees as
> Python's biggest missing piece - the thing that beginning programmers
> look for and don't find - a decent, well- supported and elegant GUI.

I disagree. It's not 1995 any more. As much as it pains me to acknowledge
it, the world has moved on and the cutting edge is in the browser, not
the desktop. That's not to say that desktop apps aren't important, they
are, but the web is where all the action is.



--
Steven
From: Martin v. Loewis on
> Martin, just to reinforce the point... developers using Tkinter need to
> make some fairly minor changes to their application code to truly take
> advantage of the improvements in recent versions of Tk. Without those
> app changes, they're not going to see any difference.
>
> To quote from the first section of the tutorial at http://www.tkdocs.com

Unfortunately, neither that tutorial nor your postings are really
specific on what those changes might be. So I'm skeptical that they
actually exist, or, if they exist, that Tkinter needs to change at all
to accomodate them.

Regards,
Martin
From: Kevin Walzer on
On 6/9/10 7:45 PM, Martin v. Loewis wrote:

> Unfortunately, neither that tutorial nor your postings are really
> specific on what those changes might be. So I'm skeptical that they
> actually exist, or, if they exist, that Tkinter needs to change at all
> to accomodate them.
>

The changes that need to be made are to incorporate the new themed Tk
(ttk) widgets into your Tkinter application--based on Guilherme Polo's
work integrating the new widgets into the stdlib.
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
From: Mark Roseman on
"Martin v. Loewis" <martin(a)v.loewis.de> wrote:
> > To quote from the first section of the tutorial at http://www.tkdocs.com
>
> Unfortunately, neither that tutorial nor your postings are really
> specific on what those changes might be. So I'm skeptical that they
> actually exist, or, if they exist, that Tkinter needs to change at all
> to accomodate them.


Ok, take a look at the last section on this page then:
http://www.tkdocs.com/resources/backgrounder.html

The change is the new so-called 'themed' widget set (ttk), which
complements but does not replace the standard widgets. And yes, Tkinter
would have to change a bit to use that widget set.

Luckily enough, that work has also long been done (thanks to Guilherme
Polo) and is a standard part of Tkinter as bundled with Python.

As for the changes that need to be made to Python application programs
to use these 'ttk' widgets instead of the classic Tk ones, the TkDocs
tutorial describes that in detail.

I trust that spending a few additional minutes with this material (or
doing a Google search on 'ttk widgets') will help address your
skepticism that changes were in fact made, and that these changes are
being used everyday by developers working with Tk in Python, Ruby, Perl,
Tcl and more.

No question that awareness of these significant changes is far too low,
and that perhaps some of the energy devoted to anxiety about Tkinter's
shortcomings could be better spent learning about or communicating this
information to developers who might easily benefit.

Mark
From: bart.c on

"Steven D'Aprano" <steve-REMOVE-THIS(a)cybersource.com.au> wrote in message
news:4c101fbc$0$28644$c3e8da3(a)news.astraweb.com...
> On Wed, 09 Jun 2010 04:16:23 -0700, ant wrote:
>
>
>> 1 Although a few advocates of Tkinter have spoken in favour of it, most
>> seem to think that:
>> It's not particularly elegant, either in its use or its
>> implementation with Tcl/Tk
>> If we didn't have a GUI in the distribution, we wouldn't choose
>> Tkinter now; it seems like its inclusion
>> is a sort of historical accident.
>
> I'm not so sure about that. If we didn't have a GUI, what would we
> include?

Is the Tkinter GUI also the basic way that Python handles a graphics
display? (I've never tried it.)

If it is, then perhaps it's possible to split the purely graphical drawing
stuff (which is simple) from the dialog/widget stuff (which is not so
simple).

A library for graphical display, plus basic user-input, should be
straightforward to implement. And can be used to produce crude (non-native)
GUIs.

--
Bartc