Next / Previous / Contents / TCC Help System / NM Tech homepage

4. fontselector: A small test driver

Here is a small Tkinter application that you can use to try out the FontSelect widget.

The driver starts with a prologue making it self-executing (under Unix), and a comment that points back to this documentation.

fontselector
#!/usr/bin/env python
#================================================================
# fontselector: Test driver for FontSelect
#
# For documentation, see:
#   http://www.nmt.edu/tcc/help/lang/python/examples/fontselect/
#----------------------------------------------------------------

from Tkinter import *
import tkFont
import fontselect

4.1. The Application class

Next we start declaring the Application class, which embodies the entire graphical user interface.

fontselector
class Application(Frame):
    """GUI for fontselector

      State/Invariants:
        .fontSelect:  [ self's FontSelect widget ]
    """