Tkinter--does anyone use it for sophisticated GUI development?

K

Kevin Walzer

I'm a Tcl/Tk developer who has been working, slowly, at learning Python,
in part because Python has better support for certain kinds of
applications that I want to develop than Tcl/Tk does. Naturally, I
thought that I would use Tkinter as the GUI for these programs. However,
in doing research into GUI development techniques, sample code, and
showcase applications, what has struck me is how little sophisticated
GUI development seems to be done in Tkinter as compared to, say,
wxPython. I've found plenty of tutorials on how to do basic GUI stuff
with Tkinter, but that stuff pretty much ends with the core Tk widgets
(buttons, entry fields, scrollbars, and menu items).

Coming from Tcl/Tk, where there are a huge number of extension packages
to enhance the Tk widgets and which allow you to make really polished
GUI's, I'm struck mainly by how little of this stuff has made it over
into Tkinter/Python. For instance, I've developed several Tcl
applications that use the core Tk widgets, the Tile theming package, the
Bwidget set (great tree widget and listbox, which allows you to embed
images), and tablelist (an extremely flexible muti-column listbox
display). I've found Python wrappers for some of this stuff, but almost
no documentation on how to use them, and very little in the way of
actual applications making use of them--which is itself a red flag. And
most of the pure-Python extension stuff that I've found, such as Python
megawidgets, is pretty dated/ugly and lags far behind the comparable
stuff on the Tcl side.

Am I better off biting the bullet and learning wxPython--a different GUI
paradigm to go with the new language I'm trying to learn? I had hoped to
reduce my learning curve, but I'm very concerned that I simply can't do
what I want to do with Tkinter. What do other Tkinter developers think?
 
J

James Stroud

Kevin said:
I'm a Tcl/Tk developer who has been working, slowly, at learning Python,
in part because Python has better support for certain kinds of
applications that I want to develop than Tcl/Tk does. Naturally, I
thought that I would use Tkinter as the GUI for these programs. However,
in doing research into GUI development techniques, sample code, and
showcase applications, what has struck me is how little sophisticated
GUI development seems to be done in Tkinter as compared to, say,
wxPython. I've found plenty of tutorials on how to do basic GUI stuff
with Tkinter, but that stuff pretty much ends with the core Tk widgets
(buttons, entry fields, scrollbars, and menu items).

Coming from Tcl/Tk, where there are a huge number of extension packages
to enhance the Tk widgets and which allow you to make really polished
GUI's, I'm struck mainly by how little of this stuff has made it over
into Tkinter/Python. For instance, I've developed several Tcl
applications that use the core Tk widgets, the Tile theming package, the
Bwidget set (great tree widget and listbox, which allows you to embed
images), and tablelist (an extremely flexible muti-column listbox
display). I've found Python wrappers for some of this stuff, but almost
no documentation on how to use them, and very little in the way of
actual applications making use of them--which is itself a red flag. And
most of the pure-Python extension stuff that I've found, such as Python
megawidgets, is pretty dated/ugly and lags far behind the comparable
stuff on the Tcl side.

Am I better off biting the bullet and learning wxPython--a different GUI
paradigm to go with the new language I'm trying to learn? I had hoped to
reduce my learning curve, but I'm very concerned that I simply can't do
what I want to do with Tkinter. What do other Tkinter developers think?

Its used in pymol. Also, look at my modest program at passerby.sf.net.
Not so sophisticated, but not completely simple either.

James


--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/
 
J

jmcantrell

wxPython is much more powerful and flexible. I would suggest moving
more in that direction.
 
P

Paul Rubin

Kevin Walzer said:
Am I better off biting the bullet and learning wxPython--a different GUI
paradigm to go with the new language I'm trying to learn? I had hoped to
reduce my learning curve, but I'm very concerned that I simply can't do
what I want to do with Tkinter. What do other Tkinter developers think?

I haven't yet found the need to switch to wxPython. Tkinter is
something of a least common denominator and as such it's been ok for
the stuff I've used it for. However, tkinter's unpopularity is well
grounded:

- Tk widgets have their own look, which is both non-native and IMO ugly
- limited widget set, especially the widgets included with python
- clumsy programming interface (but wxpython is also clumsy)

If you look at IDLE (the fanciest Tkinter app I've examined) the code
is near incomprehensible.

I have yet to see a gui toolkit which doesn't suck. I'm not sure why
that is.

Sometimes instead of a gui, I put a local http server into the app,
and connect to it with a browser. Then I do the whole gui in html.
This has many advantages and often not that much of a downside.
There's a language called Picolisp in which this is the standard way
to do a gui. Picolisp includes a java applet that can do some stuff
that standard html widgets can't. These days I suppose it should use
AJAX.
 
F

Fredrik Lundh

Kevin said:
Coming from Tcl/Tk, where there are a huge number of extension packages
to enhance the Tk widgets and which allow you to make really polished
GUI's, I'm struck mainly by how little of this stuff has made it over
into Tkinter/Python. For instance, I've developed several Tcl
applications that use the core Tk widgets, the Tile theming package, the
Bwidget set (great tree widget and listbox, which allows you to embed
images), and tablelist (an extremely flexible muti-column listbox
display). I've found Python wrappers for some of this stuff, but almost
no documentation on how to use them, and very little in the way of
actual applications making use of them--which is itself a red flag.

on the other hand, such wrappers are usually extremely simple, and the
mapping between Python and Tk is trivial. there's simply not much to
add to the existing Tk module docs.
Am I better off biting the bullet and learning wxPython--a different GUI
paradigm to go with the new language I'm trying to learn?

that's almost designed to get "wx rul3z d00d" replies from the wx crowd.
let's see if they bite.
> What do other Tkinter developers think?

"Those people who have nothing better to do than post on the Internet
all day long are rarely the ones who have the most insights"

if you want to reach Tkinter developers, the following forum might be
more appropriate:

http://mail.python.org/mailman/listinfo/tkinter-discuss

that list is more focussed on solving specific problems, though; Tkinter
developers just don't seem very interested in arguments about world
domination. guess we've inherited that from the Tcl world, or maybe
we're just too busy doing stuff ;-)

</F>
 
A

Alexander Burger

Paul Rubin said:
There's a language called Picolisp in which this is the standard way
to do a gui. Picolisp includes a java applet that can do some stuff
that standard html widgets can't. These days I suppose it should use
AJAX.

Yes, in fact it does.

The currently active "testing version"

http://www.software-lab.biz/1024/?download&picoLisp.tgz

also has a plain HTML GUI, enhanced by XMLHttpRequests, in a way that it
works transparently in browsers with or without JavaScript enabled. We
are using it in all our current projects.

- Alex
 
K

Kevin Walzer

James said:
Also, look at my modest program at passerby.sf.net.
Not so sophisticated, but not completely simple either.

I did look at passerby--a nice app, and in a native Mac OS X version
also! (I'm a Mac developer.) Thanks for the pointer.
 
K

Kevin Walzer

Fredrik said:
on the other hand, such wrappers are usually extremely simple, and the
mapping between Python and Tk is trivial. there's simply not much to
add to the existing Tk module docs.

I think I might simply have to bite the bullet, actually use some of
these documented wrappers, perhaps even tweak/improve them, and then
release something that shows what's possible with them. And perhaps even
write up some "user-friendly" docs. :)
that's almost designed to get "wx rul3z d00d" replies from the wx crowd.
let's see if they bite.

That certainly wasn't my intention.
"Those people who have nothing better to do than post on the Internet
all day long are rarely the ones who have the most insights"

if you want to reach Tkinter developers, the following forum might be
more appropriate:

http://mail.python.org/mailman/listinfo/tkinter-discuss

that list is more focussed on solving specific problems, though; Tkinter
developers just don't seem very interested in arguments about world
domination. guess we've inherited that from the Tcl world, or maybe
we're just too busy doing stuff ;-)

I subscribe to that list. I agree that this particular question is
off-topic for that list.

By way of clarification, one of the things I have in mind in terms of
"sophisticated GUI's" can be found on these pages at the Tcl'ers wiki:

http://wiki.tcl.tk/13636

This page is focused on Tcl/Tk apps using the Tile extension, but many
of these apps also use extensions like Tablelist and Tktreectrl. I
haven't seen any shiny screenshots of Python apps using these extensions
yet.

Another example, that doesn't use Tile, is PgAccess:

http://www.pgaccess.org/index.php?page=NewPgAccessEnglish

This app makes use of BWidgets and Tablelist, in particular, to good
effect.

This gives you some idea of the target I'm aiming at, anyway.
 
K

Kevin Walzer

Fredrik said:
on the other hand, such wrappers are usually extremely simple, and the
mapping between Python and Tk is trivial. there's simply not much to
add to the existing Tk module docs.

I think I might simply have to bite the bullet, actually use some of
these documented wrappers, perhaps even tweak/improve them, and then
release something that shows what's possible with them. And perhaps even
write up some "user-friendly" docs. :)
that's almost designed to get "wx rul3z d00d" replies from the wx crowd.
let's see if they bite.

That certainly wasn't my intention.
"Those people who have nothing better to do than post on the Internet
all day long are rarely the ones who have the most insights"

if you want to reach Tkinter developers, the following forum might be
more appropriate:

http://mail.python.org/mailman/listinfo/tkinter-discuss

that list is more focussed on solving specific problems, though; Tkinter
developers just don't seem very interested in arguments about world
domination. guess we've inherited that from the Tcl world, or maybe
we're just too busy doing stuff ;-)

I subscribe to that list. I agree that this particular question is
off-topic for that list.

By way of clarification, one of the things I have in mind in terms of
"sophisticated GUI's" can be found on these pages at the Tcl'ers wiki:

http://wiki.tcl.tk/13636

This page is focused on Tcl/Tk apps using the Tile extension, but many
of these apps also use extensions like Tablelist and Tktreectrl. I
haven't seen any shiny screenshots of Python apps using these extensions
yet.

Another example, that doesn't use Tile, is PgAccess:

http://www.pgaccess.org/index.php?page=NewPgAccessEnglish

This app makes use of BWidgets and Tablelist, in particular, to good
effect.

This gives you some idea of the target I'm aiming at, anyway.
 
C

Christophe

Kevin Walzer a écrit :
Am I better off biting the bullet and learning wxPython--a different GUI
paradigm to go with the new language I'm trying to learn? I had hoped to
reduce my learning curve, but I'm very concerned that I simply can't do
what I want to do with Tkinter. What do other Tkinter developers think?

Nobody mentionned it, but I think you should try PyQT and PyGTK before
wxPython. Myself, I do not like wx : it looks too much like the MFC.

PyGTK is good, but GTK doesn't work that well on windows. PyQT is very
good but you need Qt4 to get a free version for Windows. And it is GPL
so it might not be what you are looking for. Or you can pay for it and
get the non GPL version.
 
J

jmdeschamps

Kevin said:
I'm a Tcl/Tk developer who has been working, slowly, at learning Python,
in part because Python has better support for certain kinds of
applications that I want to develop than Tcl/Tk does. Naturally, I
thought that I would use Tkinter as the GUI for these programs. However,
in doing research into GUI development techniques, sample code, and
showcase applications, what has struck me is how little sophisticated
GUI development seems to be done in Tkinter as compared to, say,
wxPython. I've found plenty of tutorials on how to do basic GUI stuff
with Tkinter, but that stuff pretty much ends with the core Tk widgets
(buttons, entry fields, scrollbars, and menu items).

Coming from Tcl/Tk, where there are a huge number of extension packages
to enhance the Tk widgets and which allow you to make really polished
GUI's, I'm struck mainly by how little of this stuff has made it over
into Tkinter/Python. For instance, I've developed several Tcl
applications that use the core Tk widgets, the Tile theming package, the
Bwidget set (great tree widget and listbox, which allows you to embed
images), and tablelist (an extremely flexible muti-column listbox
display). I've found Python wrappers for some of this stuff, but almost
no documentation on how to use them, and very little in the way of
actual applications making use of them--which is itself a red flag. And
most of the pure-Python extension stuff that I've found, such as Python
megawidgets, is pretty dated/ugly and lags far behind the comparable
stuff on the Tcl side.

Am I better off biting the bullet and learning wxPython--a different GUI
paradigm to go with the new language I'm trying to learn? I had hoped to
reduce my learning curve, but I'm very concerned that I simply can't do
what I want to do with Tkinter. What do other Tkinter developers think?

Tkinter is certainly dated (?), worst than PMW which is built upon it.

But what do you what/need?
I use , and am making my students use Tkinter for a web multiu-user
client-server XXXX game. The Canvas is a great object, but you have to
write the code yourself, if you want a special look.
Eye-candy, Tkinter ain't, and it doesn't have a lot of sophisticated
widgets (again ?) . I wanted a tabbed pane last year and made myself
one (not the exact look of others, but functional if what you want is
multiple frames of widgets for each tab; the table widget took quite a
bit of doing, also and it's not an Excel spreadsheet)

I do know that people are impressed by glitz and glamour (And I don't
have a nice tree (with picture) widget)

But all of this does forget that Tkinter is still in the standard
library, while all others are third-party add-ons... so there is a
extra hassle with them...

So, what do You want? (widgets, criterias etc)

Jean-Marc
 
P

Paul Rubin

greg said:
Have you seen PyGUI? It's my attempt at creating a GUI toolkit for
Python that doesn't suck. I'd be interested to know if you think
I've come anywhere near to succeeding.

http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/

I hadn't seen it. I just spent a couple minutes looking at the docs.
I didn't really get that much sense of what it's like. I may look at
it some more later. However, like tkinter, it seems pretty low level.
I do like that it doesn't rely on the user knowing anything about a
completely separate language, in order to program the gui from Python.
 
S

sturlamolden

Christophe said:
Nobody mentionned it, but I think you should try PyQT and PyGTK before
wxPython. Myself, I do not like wx : it looks too much like the MFC.

PyGTK is good, but GTK doesn't work that well on windows.

GTK and PyGTK works well on Windows now. GTK used to be unstable on
Windows, but that has been taken care of. I would not use anything else
but PyGTK for GUI development in Python. Go here to get the Windows
port:

http://www.mapr.ucl.ac.be/~gustin/win32_ports/

With PyGTK and GLADE, the GUI can be designed in GLADE and imported as
an XML-resource (using libglade). It saves us of all the tedious
GUI-programming. All that is needed is the event handlers, which we
obviously have to code. When they are done, we simply put references to
them in a dictionary, and tell libglade to dispacth on it. All the GUI
programming crap is hidden away. Since there is no actual GUI code in
Python, it also makes maintenance and upgrading much easier: The GUI
can be redesigned in GLADE without affecting the Python code. Have you
ever tried to change anything in an MFC project with Visual C++? It's a
nightmare.
 
K

Kevin Walzer

sturlamolden said:
GTK and PyGTK works well on Windows now. GTK used to be unstable on
Windows, but that has been taken care of. I would not use anything else
but PyGTK for GUI development in Python. Go here to get the Windows
port:

http://www.mapr.ucl.ac.be/~gustin/win32_ports/

With PyGTK and GLADE, the GUI can be designed in GLADE and imported as
an XML-resource (using libglade). It saves us of all the tedious
GUI-programming. All that is needed is the event handlers, which we
obviously have to code. When they are done, we simply put references to
them in a dictionary, and tell libglade to dispacth on it. All the GUI
programming crap is hidden away. Since there is no actual GUI code in
Python, it also makes maintenance and upgrading much easier: The GUI
can be redesigned in GLADE without affecting the Python code. Have you
ever tried to change anything in an MFC project with Visual C++? It's a
nightmare.
I'm a Mac developer--Gtk does not run natively on the Mac (i.e. as an
Aqua framework), only under X11. So that's a non-starter for me.
 
D

Diez B. Roggisch

I'm a Mac developer--Gtk does not run natively on the Mac (i.e. as an
Aqua framework), only under X11. So that's a non-starter for me.


Besides the excellent PyObjc-bridge that of course only works for
Mac-only-development, you might consider PyQt. Biggest drawback: the
GPL-license. But feature-wise, it beats IMHO all other toolkits.

It looks pretty well under OSX. Not absolutely perfect, but certainly
better that the alternatives. Google earth for example is created with
it, at least in the Mac-incarnation.

Diez
 
W

Wektor

Kevin said:
I'm a Mac developer--Gtk does not run natively on the Mac (i.e. as an
Aqua framework), only under X11. So that's a non-starter for me.

You have 2 choices then wxWidgets or Qt.
wx has also graphical editors like Glade (there is a wxGlade project)
giving a xml description of a window and its cross platform.
I know there are graphical for Qt but i dont know if theyre giving xml
or are just code-generators.
You could also do gui in Java or .Net and use python with their native
interpreter (jython is a bit outdated but IronPython is "online")
You can also use a local web app with one of cool Python'ish web
frameworks -- id suggest TurboGears, but you can choose from many ill
mention Django (which is i think the biggest rival for TG)

On the other hand its a pity that there isnt much choice in cross
platform (win mac lin) GUI platforms until now i was a great fan of GTK
but there isnt a proper port for Mac.
Its also a pity that no one didnt do something based on OpenGL with
python (or maybe im wrong) it could be cool and really cross-platform.
 
S

sturlamolden

Kevin said:
I'm a Mac developer--Gtk does not run natively on the Mac (i.e. as an
Aqua framework), only under X11. So that's a non-starter for me.

GTK is skinnable and can look a lot like Aqua. Qt is also just
pretending to be a native Aqua toolkit (or used to), but it is very
good at it.

That leaves you with wxPython (utterly ugly API, remninds me of MFC and
Motif), PyQt (very expensive unless GPL is not a show stopper) or
PyObjC.

http://pyobjc.sourceforge.net/
http://pyobjc.sourceforge.net/doc/tutorial.php

If you are willing to use Jython, you can get a native Aqua GUI from
Java.

Does at GUI really have to be "native"? I never hear anyone complain
about the looks of Microsoft Office or Mozilla Firefox on Windows,
although neither have a "native" GUI.
 
S

sturlamolden

Wektor said:
wx has also graphical editors like Glade (there is a wxGlade project)
giving a xml description of a window and its cross platform.

If you are thinking about XRC, then beware that this XML don't solve
any problems, it just creates another. XRC and libglade do not compare.
libglade makes the GUI development easy and the program code clean and
easy to read. XRC makes the GUI development difficult and the program
code convoluted and difficult to read.

Also wxGlade is not GLADE. In particular, wxGlade is unstable and tend
to crash or do stupid things. But if your oalternative is to hand-code
the wxPython GUI, then wxGLADE is nevertheless the better option.
On the other hand its a pity that there isnt much choice in cross
platform (win mac lin) GUI platforms until now i was a great fan of GTK
but there isnt a proper port for Mac.

GTK is being ported to Aqua, but the port it is in its early stages.
Its also a pity that no one didnt do something based on OpenGL with
python (or maybe im wrong) it could be cool and really cross-platform.

You are wrong. There are PyOpenGL and there is cross-platform GUI and
game development platforms that use it (PyGTK, wxPython, PyGame). There
are also PyOgre, which are more pythonic than using OpenGL directly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top