on ttk widgets, see the entry in the Python library manual or search the Web; this
book focuses on tkinter fundamentals, and tix and ttk are both too large to cover
in a useful fashion here.
PIL
The Python Imaging Library (PIL) is an open source extension package that adds
image-processing tools to Python. Among other things, it provides tools for image
thumbnails, transforms, and conversions, and it extends the basic tkinter image
object to add support for displaying many image file types. PIL, for instance, allows
tkinter GUIs to display JPEG, TIFF, and PNG images not supported by the base
tkinter toolkit itself (without extension, tkinter supports GIFs and a handful of
bitmap formats). See the end of Chapter 8 for more details and examples; we’ll use
PIL in this book in a number of image-related example scripts. PIL can be found
at http://www.pythonware.com or via a web search.
IDLE
The IDLE integrated Python development environment is both written in Python
with tkinter and shipped and installed with the Python package (if you have a recent
Python interpreter, you should have IDLE too; on Windows, click the Start button,
select the Programs menu, and click the Python entry to find it). IDLE provides
syntax-coloring text editors for Python code, point-and-click debugging, and more,
and is an example of tkinter’s utility.
Others
Many of the extensions that provide visualization tools for Python are based on
the tkinter library and its canvas widget. See the PyPI website and your favorite
web search engine for more tkinter extension examples.
If you plan to do any commercial-grade GUI development with tkinter, you’ll probably
want to explore extensions such as Pmw, PIL, Tix, and ttk after learning tkinter basics
in this text. They can save development time and add pizzazz to your GUIs. See the
Python-related websites mentioned earlier for up-to-date details and links.
tkinter Structure
From a more nuts-and-bolts perspective, tkinter is an integration system that implies
a somewhat unique program structure. We’ll see what this means in terms of code in
a moment, but here is a brief introduction to some of the terms and concepts at the
core of Python GUI programming.
Implementation structure
Strictly speaking, tkinter is simply the name of Python’s interface to Tk—a GUI library
originally written for use with the Tcl programming language and developed by Tcl’s
creator, John Ousterhout. Python’s tkinter module talks to Tk, and the Tk library in
turn interfaces with the underlying window system: Microsoft Windows, X Windows
366 | Chapter 7: Graphical User Interfaces