Abstract
Describes the Tkinter widget set for
constructing graphical user interfaces (GUIs) in the
Python programming language.
This publication is available in Web form and also as a PDF document. Please
forward any comments to tcc-doc@nmt.edu.
Table of Contents
Button widgetCanvas widgetCanvas coordinatesCanvas display listCanvas object IDsCanvas tagsCanvas tagOrId argumentsCanvas widgetsCanvas arc objectsCanvas bitmap objectsCanvas image objectsCanvas line objectsCanvas oval objectsCanvas polygon objectsCanvas rectangle objectsCanvas text objectsCanvas window objectsCheckbutton widgetEntry widgetFrame widgetLabel widgetLabelFrame widgetListbox widgetMenu widgetMenubutton widgetMessage widgetOptionMenu widgetPanedWindow widgetRadiobutton widgetScale widgetScrollbar widgetSpinbox widgetText widgetToplevel: Top-level window
methodsTkinter is a GUI (graphical user interface) widget set for Python. This document contains only the commoner features.
This document applies to Python 2.5 and Tkinter 8.4 running in the X Window system under Linux. Your version may vary.
Pertinent references:
Fredrik Lundh, who wrote Tkinter, has two versions of his An Introduction to Tkinter: a more complete 1999 version and a 2005 version that presents a few newer features.
Python and Tkinter Programming by John Grayson (Manning, 2000, ISBN 1-884777-81-3) is out of print, but has many useful examples and also discusses an extension package called Pmw: Python megawidgets.
Python 2.5 quick reference: general information about the Python language.
For an example of a sizeable working application (around 1000 lines of code), see huey: A color and font selection tool.
We'll start by looking at the visible part of Tkinter: creating the widgets and arranging them on the screen. Later we will talk about how to connect the face—the “front panel”—of the application to the logic behind it.