Abstract
Describes a graphical user interface widget that displays the fonts available with the Python programming language's Tkinter widget set.
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
fontselector: A small test driverfontselect.py: The moduleclass FontSelectFontSelect.__init__(): ConstructorFontSelect.__createWidgets(): Widget
placementFontSelect.__familyHandler():
Callback for family changesFontSelect.__controlHandler():
Callback for any font changeFontSelect.get(): Return the current
fontFontSelect.getName(): Return the current
font nameFontSelect.addObserver(): Register a
callbackclass FamilyPicker: Widgets for
selecting the font familyclass Controls: Controls frameControls.__init__(): ConstructorControls.__createWidgets()Controls.__createButtons(): Lay out the small
controls frameControls.__setFont(): Font change
handlerControls.setFamily(): Change font family
nameControls.getName(): Get the current
font nameControls.getFont(): Return the
current fontThis document describes a graphical user interface widget that allows the user to select a particular text font. This widget works with the Tkinter graphical user interface for the Python programming language.
The document also contains the actual code of the widget, explained in a lightweight literate programming style.
Relevant documents:
Python 2.2 quick reference describes the Python language.
Tkinter reference: a GUI for Python describes the Tkinter widget set.
See the author's Lightweight Literate Programming page for an explanation of the technique of embedding the program in its internal documentation.
See also the author's page on the Cleanroom software methodology for a discussion of the author's preferred style of implementation.
Files extracted from this document:
fontselect.py: Module containing .
fontselector: Test driver.