[Tutor] Tkinter

Doug Hellmann doughellmann@mindspring.com
Wed, 10 Mar 1999 21:37:41 -0500


Hi, Jon,

I have been going through the Tk/Tkinter learning curve over the past 6
months.  It took a little while to get up to speed, but now I'm writing
my own Python Mega Widgets (Pmw - http://www.dscpl.com.au/pmw/) -- check
out my widgets at http://www.mindspring.com/~doughellmann/Projects/PmwContribD.

Of course, that doesn't help with your question.  It isn't clear whether
you are having trouble with Tkinter, or Tk, or both.  What sort of
GUI/Tk/Python background do you have?  I was learning both Tk and
Tkinter at the same time (though at least I was already fairly fluent
with Python).  I found _Practical Programming in Tcl and Tk_ useful as a
good Tcl/Tk book.  It helped to translate some of the examples in to
Python, as exercises.

For creating a dialog, I would start by looking at the SimpleDialog.py
source file in your Python distribution.  The __init__ method shows how
to create a dialog which will respond to different button presses.  You
probably don't need to worry about all of the geometry management stuff
at first.  If you want the user to be able to enter a value, take a look
at the Entry widget -- the basic text field widget for getting simple
values from the user.

Pmw has some canned classes to do these sorts of things, and you can
look at that code too.  Since there is a lot of Pmw-specific overhead
though, that might be more confusing.

Doug

> Jon Cosby wrote:
> 
> I need some help with Tkinter, and find the Pythonware tutorial to be
> lacking. I'd like create a button to call an application and dialog
> window for input, and present the results. Are there some good
> examples to look at to get me started?
> 
> Jon Cosby