Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Tkinter: The good, the bad, and the ugly!

Reply
Thread Tools

Tkinter: The good, the bad, and the ugly!

 
 
rantingrick
Guest
Posts: n/a
 
      12-29-2010

Tkinter: The good, the bad, and the ugly!
-----------------------------------------
An expose by rantingrick


----------------------
The Good
----------------------
Back in the early days of Python --when this simplistic beauty of
programming bliss we enjoy today was just a tiny glimmer of hope in a
archaic world plagued by dark forest of braces and jagged caverns of
cryptic syntaxes-- our beloved dictator (Mr. Van Rossum) had the
foresight to include a simplistic GUI toolkit that we call Tkinter
into the stdlib. And he saw that it was great, and that it was good,
and so he rested.

And when the first python programmers used this gift handed down from
the gods they were pleased. They could see that all of the heavy work
of cross-platform-ism landed square on the shoulders of TCL/Tk and all
Python had to do was wrap a few methods to wield the beast we all know
as graphical user interfaces.

Life was good, people were happy...but darkness loomed on the
horizon...


----------------
Enter the Bad
----------------
However as we all know there exists no real Utopian bliss without many
pitfalls and snares. Since Tkinter is just a wrapping of some TclTk
calls the people realized that they are now at the perilous mercy of
another group of developers (psst: thats the TCL folks!) who have only
their own goals and dreams in mind and could care less for the
troubles of others. They realized that Tkinter was lacking. However
this lacking was not Tkinters fault, no, the fault lye with TclTk. And
to compound these problems they also realized that in order to fix the
design problems inherit in TclTk they must learn an obscure and mostly
useless language... TclTk!!

--------------------------------
Utterly destroyed by the Ugly!
--------------------------------
And then the people became very angry... "What a double cross!" they
chanted. Why should we learn a language like TclTk just to fix
problems that the TclTk folks need to fix themselves? Would not that
time be more wisely spent in looking over code that is 100% Python and
modifying it? Not only would our community benefit but we can
propagate the maintainece and/or improvements to a wider group of
folks by removing the high entrance requirements. When we elevate
every python programmer to a PythonGUI maintainer then we will have
achieved community nirvana!

We have now reached a point where the very simplicity we have embraced
(Tkinter) has become a stumbling block not only for the users of
Tkinter, but more devastating is the damage this TCL/Tk monkey has
done to keep our fellow Python brothers and sisters from learning how
a GUI kit works (behind the scenes) with each OS to bring all this
graphical stuff to life.

------------------------
So what should we do?
------------------------
The answer is simple. We need a 100% Python GUI. A GUI coded in Python
from top to bottom. A GUI that is cross platform to the big three
(Windows, Linux, and Mac). A GUI that not only is easy as Tkinter but
also a GUI that can be manipulated by the average python programmer. A
GUI that not only teaches the fundamentals of using a GUI, but also a
GUI that teaches how a GUI works under the hood

Then and only then will Python be truly what GvR intended. I want
everyone here to consider what i am proposing and offer some opinions
because it is time for change.
 
Reply With Quote
 
 
 
 
Katie T
Guest
Posts: n/a
 
      12-30-2010
On Wed, Dec 29, 2010 at 11:58 PM, rantingrick <(E-Mail Removed)> wrote:
>
> Then and only then will Python be truly what GvR intended. I want
> everyone here to consider what i am proposing and offer some opinions
> because it is time for change.


What's your opinion of the other gui toolkits with Python bindings
like PyQt and PyGtk?

Katie
--
CoderStack
http://www.coderstack.co.uk/perl-jobs
The Software Developer Job Board
 
Reply With Quote
 
 
 
 
rantingrick
Guest
Posts: n/a
 
      12-30-2010
On Dec 29, 6:07*pm, Katie T <(E-Mail Removed)> wrote:
> On Wed, Dec 29, 2010 at 11:58 PM, rantingrick <(E-Mail Removed)> wrote:
>
> What's your opinion of the other gui toolkits with Python bindings
> like PyQt and PyGtk?


Hello KateT,

Well i like wxPython as it is quite well rounded but we all know it
has some shortcomings too and wx is far too bloated for the stdlib!
pyQt and pyGtk i cannot comment on because i have no experience with
them.

However i need to stress that my intention is towards a 100% Python
GUI. Not a binding, not a wrapping (except for OS calls!) but a *real*
Python GUI. The only thing that i know of at this point is pyGUI
although there are probably others. Allowing the average Python
programmer the ability to read OS specific calls written in Python
would not only benefit their GUI knowledge, but also there knowledge
of OS's in general.

I guess you could sum it as "Getting the most bang for your community
buck".
 
Reply With Quote
 
Gerry Reno
Guest
Posts: n/a
 
      12-30-2010
wxPython looks good but I don't see anyone developing support for things
like smartphones.

Also, what do you think about frameworks such as pyjamas? It lets you
write in python and compiles everything down to Javascript so it can be
used across the Web as well as on the desktop.


 
Reply With Quote
 
Octavian Rasnita
Guest
Posts: n/a
 
      12-30-2010
From: "rantingrick" <(E-Mail Removed)>
> Back in the early days of Python --when this simplistic beauty of
> programming bliss we enjoy today was just a tiny glimmer of hope in a
> archaic world plagued by dark forest of braces and jagged caverns of
> cryptic syntaxes-- our beloved dictator (Mr. Van Rossum) had the
> foresight to include a simplistic GUI toolkit that we call Tkinter
> into the stdlib. And he saw that it was great, and that it was good,
> and so he rested.



Yes, for that time it was good.

> Life was good, people were happy...but darkness loomed on the
> horizon...


Not all the people were happy because the darkness disappeared partially for some of them and more and more blind people started to use a computer, and discovered that the Tk interfaces are absolutely inaccessible for them.

> The answer is simple. We need a 100% Python GUI. A GUI coded in Python
> from top to bottom. A GUI that is cross platform to the big three
> (Windows, Linux, and Mac). A GUI that not only is easy as Tkinter but
> also a GUI that can be manipulated by the average python programmer. A
> GUI that not only teaches the fundamentals of using a GUI, but also a
> GUI that teaches how a GUI works under the hood



So it should be a kind of SWING library made in Python, right?
It is a good idea, but it should not have the problems of SWING and in that case it would be very hard to do.

First, the interface should look exactly as the native interfaces for each system named, and it should provide the same features, because otherwise the interface would look strange for all the users on all the operating systems.
And of course, it should not only look OK, but it should also follow the accessibility standards for beeing accessible for screen readers also.

WxPython is the best GUI because it is fast, even though it is bloated, it uses the native GUI elements on all those 3 operating systems and a relatively good accessibility for screen readers.

But WxPython still have problems because not all operating systems native GUIS offer the same widgets and features and those features custom-made don't respect the accessibility standards.

WxPython is fast because it is made in C - it uses the native GUI elements of the OS which are also made in C. Would a Python - only GUI have the same speed? If yes, it would be great.

Octavian

 
Reply With Quote
 
Octavian Rasnita
Guest
Posts: n/a
 
      12-30-2010
From: "Katie T" <(E-Mail Removed)>
> What's your opinion of the other gui toolkits with Python bindings
> like PyQt and PyGtk?
>
> Katie
> --



They are not accessible at all for screen readers, so the programs that still use them won't be accessible to all potential users.

Octavian


 
Reply With Quote
 
rantingrick
Guest
Posts: n/a
 
      12-30-2010
On Dec 29, 6:41*pm, Gerry Reno <(E-Mail Removed)> wrote:
> wxPython looks good but I don't see anyone developing support for things
> like smartphones.


No wx is not the answer to our problems

> Also, what do you think about frameworks such as pyjamas? *It lets you
> write in python and compiles everything down to Javascript so it can be
> used across the Web as well as on the desktop.


Hmm, this is like two double edged swords smashing one another in
battle.

Sword One: On one hand web frameworks are going to be really big soon
-- however legacy GUI's are not going away any time soon!

Sword Two: On the other hand web frameworks provide awesome cross
platform ability that is surly only going to get better as time goes
-- however i utterly hate JavaScript (although much worse web
languages exist!). And sending requests back and forth between Python,
JavaScript, and BrowserX is also a real PITA. Because even though
everyone knows this is coming all the major browsers are trying to
insert their API into the mix. So that Joe Scripter has to write code
that is compatible between many browsers. Until the world agrees on a
unified API --AND IMPLEMENTS IT SERIOUSLY-- we are at the mercy of
drunken sailors at the helm.

I believe pyjamas has a bright future in the web playground, however
we still need to focus our community efforts towards a Python based
GUI. I can see a pythonGUI and pyjamas existing side by side in mutual
harmony for many years.

 
Reply With Quote
 
Steven D'Aprano
Guest
Posts: n/a
 
      12-30-2010
On Wed, 29 Dec 2010 15:58:53 -0800, rantingrick wrote:

> Tkinter: The good, the bad, and the ugly!
> -----------------------------------------
> An expose by rantingrick



Your ideas are intriguing to me and I wish to subscribe to your
newsletter.


> The answer is simple. We need a 100% Python GUI. A GUI coded in Python
> from top to bottom. A GUI that is cross platform to the big three
> (Windows, Linux, and Mac). A GUI that not only is easy as Tkinter but
> also a GUI that can be manipulated by the average python programmer. A
> GUI that not only teaches the fundamentals of using a GUI, but also a
> GUI that teaches how a GUI works under the hood


I look forward to seeing this software of yours. Let us know when you've
got some code, and not just empty talk.



--
Steven
 
Reply With Quote
 
Adam Skutt
Guest
Posts: n/a
 
      12-30-2010
On Dec 29, 7:48*pm, "Octavian Rasnita" <(E-Mail Removed)> wrote:
> First, the interface should look exactly as the native interfaces for each system named, and it should provide the same features, because otherwise the interface would look strange for all the users on all the operating systems.
> And of course, it should not only look OK, but it should also follow the accessibility standards for beeing accessible for screen readers also.
>


Which is where the contradiction comes into play: to use the actual
native widgets, you have to write some C (or Objective-C). Of course,
on Windows, people have faked the native widgets so many times that
you could probably get away with it if you made a really good fake,
though there are still a lot of gotchas that go with that
(accessibility and all that "other stuff"). On Linux, it's not like
there's really a standard anyway. That leaves OS X as the really
troublesome one.

>WxPython is fast because it is made in C - it uses the native GUI elements of the OS which are also made in C. Would a Python - only GUI have the same speed? If yes, it would be great.
>


Speed is not even on the list of things I'd be worried about first.

Adam
 
Reply With Quote
 
Kevin Walzer
Guest
Posts: n/a
 
      12-30-2010
On 12/29/10 6:58 PM, rantingrick wrote:
> The answer is simple. We need a 100% Python GUI. A GUI coded in Python
> from top to bottom. A GUI that is cross platform to the big three
> (Windows, Linux, and Mac). A GUI that not only is easy as Tkinter but
> also a GUI that can be manipulated by the average python programmer. A
> GUI that not only teaches the fundamentals of using a GUI, but also a
> GUI that teaches how a GUI works under the hood


Any GUI framework is going to require at least some heavy lifting in C,
C++ or Objective-C (depending on the platform). A pure-Python approach
to GUI development is technically infeasible.

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if and and vs if and,and titi VHDL 4 03-11-2007 05:23 AM



Advertisments