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
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.
> 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>
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
Weell, I'm in no position to evangelise it, but alongised other things
for the past two or three weeks I've been looking into different gui
building tools for python, wxDesigner, BoaConstructor, pythonCard and a
couple of others using both tkInter and wxPython.
I've given up trying to find a good one who's method of operation was
quick to pick up, and I've since written the basics of my GUI by hand in
TkInter and now wxPython (was doing that last night as it goes).
..aand so far wxPython is winning easily on the hand-coded front,
especially once you find the demo package and use it. TkInter took me 3
or 4 days without help to work out and build what I needed. WxPython
took an evening and 1 usenet post. And I think it looks much nicer.
I've yet to see what happens with the event loop of either when I start
to use the threaded scheduler I need in the app but hey...
Matt.
(in wrong place to get to google groups again.. As always apologies for
appended text)
--
This email is confidential and may be privileged. If you are not the intended recipient please notify the sender immediately and delete the email from your computer.
You should not copy the email, use it for any purpose or disclose its contents to any other person.
Please note that any views or opinions presented in this email may be personal to the author and do not necessarily represent the views or opinions of Digica.
It is the responsibility of the recipient to check this email for the presence of viruses. Digica accepts no liability for any damage caused by any virus transmitted by this email.
UK: Phoenix House, Colliers Way, Nottingham, NG8 6AT UK
Reception Tel: + 44 (0) 115 977 1177
Support Centre: 0845 607 7070
Fax: + 44 (0) 115 977 7000
http://www.digica.com
SOUTH AFRICA: Building 3, Parc du Cap, Mispel Road, Bellville, 7535, South Africa
Tel: + 27 (0) 21 957 4900
Fax: + 27 (0) 21 948 3135
http://www.digica.com
> 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.
--
Kevin Walzer
Poetic Code
http://www.kevin-walzer.com
>
> 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. :-)
>
>> 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.
That certainly wasn't my intention.
>
>> 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 ;-)
>
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:
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.
--
Kevin Walzer
Poetic Code
>
> 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. :-)
>
>> 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.
That certainly wasn't my intention.
>
>> 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 ;-)
>
I subscribe to that list. I agree that this particular question is
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.
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
> I have yet to see a gui toolkit which doesn't suck. I'm not sure why
> that is.
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/
--
Greg
> I have yet to see a gui toolkit which doesn't suck. I'm not sure why
> that is.
Have you seen PyGUI? It's my attempt at creating
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.
> 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.
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
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.
> 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.
> 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.
> 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 alternative 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
> pygtk can be a pain to install and some of the librarys that are built
> on top of it have copyrights and such. apple for the fonts and there
> is one for the images. It also can be a pain to install.. It would be
> nice to see it as a low cost comercial package that is already put
> together say $20 or so then to try to workout a distribution for some
> of that.
On Windows, there are two installers you need to download: One for
PyGTK and one for GLADE + the GTK runtime. Double-click on the
installers and wheeey ... everything works.
http://www.mapr.ucl.ac.be/~gustin/win32_ports/pygtk.html
http://gladewin32.sourceforge.net/modules/news/
If you cannot make this work, your computer skills are at level that
makes me amazed that you have any use for a programming language...
> (but then I believe apple should buy borland). I think
> sci-pi (If I have the name right) would be a very good platform to
> extend gtk. A) it is well documentated B) they made it as easy as
> possible to install. pywin might have some acess to graphics but it is
> windows only and the documentation is sparce.
SciPy is a toolset for scientific programming in Python. It does not
contain any graphics stuff. SciPy depends on NumPy (formerly SciPy
core), which is the "bleeding edge" package for numerical programming
in Python. If you need to scientific datavisualization in Python, you
should take a look at Matplotlib, which also depends on NumPy.
Matplotlib can use a number of backends for displaying graphs,
including PyGTK. I routinely use Matplotlib to draw graphs in my PyGTK
apps on MS Windows. This jus requires two or three installs: NumPy,
Matplotlib and (optionally) SciPy. But you don't need this packages
unless you are doing heavy scientific or numeric programming.
> 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 tried to look for a python-library when I started using
tablelist. The only link I found was quite dead.
I spent a day or two while learning how to do a minimal (i.e. only
those methods that I have needed) implementation from scratch :(
It seems to work quite well for my purposes.
> I've found Python wrappers for some of this stuff, but almost
> no documentation on how to use them
>
Is there sufficient documentation for the Tcl/Tk libraries that the
wrappers have been coded for? At least with Tkinter and Tix it is
usually quite obvious what is the corresponding python method if you
know the Tcl/Tk counterpart.
Jani Hakala
> 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.
I too hated the wxPython API, but loved how it looked. And since I
need things to run cross-platform (in my case, Linux and Windows), I
held my breath and coded in wxPython, because the results were well
worth it.
Now that I've discovered Dabo, which wraps wxPython, hiding the C++
ugliness under a very Pythonic API, I have the best of both worlds. I
get to code naturally, and the results look great.
--
# p.d.
I have seen a very sophisticated admin tool written in Tkinter, coming
from SAP. So apparently SAP does.
Seo Sanghyeon
With some cleaning and improving, I think wax
(http://zephyrfalcon.org/labs/wax.html ) can become good too.
Bye,
bearophile
I ment in the GUI context , a widget-based api where you can put
buttons, labels etc. on a form.
Not an advanced 3D stuff which is useless for such application.
Something like :
http://www.cs.unc.edu/~rademach/glui/
http://glow.sourceforge.net/
and sdl based
http://www.paragui.org/
but none have Python support (or again maybe im wrong)
PyGame for SDL, I think.
--
Neil Cerutti
> With some cleaning and improving, I think wax
> (http://zephyrfalcon.org/labs/wax.html ) can become good too.
I looked at Wax, but the author doesn't seem to be too involved with
it. It looks like a cool idea that he developed far enough to make it
work, and then got bored with it. I mean hell, there isn't even a
workable grid class that does anything differently than the wxPython
grid does!
Dabo's implementation is already llight years ahead of Wax, despite
entering the game much later. When you've worked with lots of open
source projects, you can tell which are actively being developed and
which are dead or comatose; you can tell which have a growing
community and which are stagnant; you can tell which are worth
investing your time into learning and/or contributing to, and which
are dead-ends. Wax feels like a real dead-end to me.
--
# p.d.
> I ment in the GUI context , a widget-based api where you can put
> buttons, labels etc. on a form.
You mean GTK?
GTK 2.8 uses an abstraction layer for drawing widgets called "Cairo".
Cairo can use OpenGL or Quartz as backends (still experimental). Thus,
you can get a hardware-accelerated GUI from PyGTK if you are willing to
use an experimental backend in Cairo.
Can you also tell when you're wrong?
I checked out Wax last week for the first time; I hit a snag and got an
answer from the lead developer within a day, along with a pointer to
the latest dev version.
But don't let communication get in the way of that six sense you've got
going there :)
- alex23
> Can you also tell when you're wrong?
>
> I checked out Wax last week for the first time; I hit a snag and got an
> answer from the lead developer within a day, along with a pointer to
> the latest dev version.
>
> But don't let communication get in the way of that six sense you've got
> going there :)
I've been following Wax for over two years. You can count the number
of new features that have been added to it in that time on one hand.
Hans is a great guy and has written some great stuff, but Wax is but a
small side project of his. I'm sure he'll support it excellently, but
I don't think I would hold my breath waiting for him to him to release
a grid that does, say, 1/10th of what the Dabo grid can do.
--
# p.d.