Which GUI?

krodgers at tdyryan.com krodgers at tdyryan.com
Wed Feb 23 12:51:37 EST 2000


In article <20000223161839.B3134 at stopcontact.palga.uucp>,
  Gerrit <gerrit at nl.linux.org> wrote:
> <quote name="Vetle Roeim" date="951312575">
> > Tkinter does NOT reinvent the wheel. I can't understand where this
comes
> > from.
>
> It provides their own classes. These classes are invented by Tkinter,
they
> do not exist in Tcl/Tk. And the methods don't even *match* with Tcl
functions!
>

Lessee if I get this now . . . your chief complaint is that there's not
a one-to-one match between Tk and Tkinter?  So because of this, Tkinter
is "reinventing the wheel"?

When I first started using Python and Tkinter, about three and a half
years ago, the only Tkinter documentation was Matt Conway's "Tkinter
Life Preserver".  While that was better than nothing, it was still
pretty dire.  Then Mark Lutz's "Programming Python" came out, with some
pretty good stuff on Tkinter. (BTW, PP has been getting some IMHO
undeserved bad press in this newsgroup lately; yes, it's big and yes,
it covers a lot of territory, but you need to remember that it was one
of the first two Python books, the first from O'Reilly, and part of its
goal was to cover as much as possible.  I like it and still use it.)
Fredrik Lundh's book-to-be has been around for, what, close to two years
now?  The Grayson book is out.  So, unless you're tchrist and refuse to
recognize any docs except Unix format manpages, the documentation
situation for Tkinter is "pretty good" right now.

I personally like the fact that Tkinter doesn't just slavishly wrap Tk.
Being able to do, e.g.,

self.lbl = StringVar()
Label(master, textvariable=self.lbl).grid()  # don't need ref to Label
self.lbl.set("This is a test . . .")

and have the label widget text change, is cool.  Tkinter manages the
widget references behind the scenes.  It may be possible to do this in
straight Tcl/Tk, but I don't have to know that - Tkinter is a
sufficiently "thick" wrapper that I don't even have to know what Tcl/Tk
"native" code looks like.

I looked at wxPython, and even subscribed to the mailing list for a
while, but I never got over the feeling that I was writing C/C++ in
Python.  I want to write Python in Python!  Tkinter "feels" like Python.
Aesthetically, I wish that Tk were bound more closely to the Win32
widget set (instead of "emulating" most of the widgets), but the TkGS
project will change that.

To each his/her own.  But I certainly plan to keep paying attention to
what I have to do to write code, and how pleasant that is, and whether
it works, and not worry overmuch about the "purity" of the OO layers
beneath.

oooeee-GUI-ly y'rs Kevin


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list