Next / Previous / Contents / Shipman's 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
#
# Do not edit this file directly.  It is mechanically extracted
# from the documentation:
#   http://www.nmt.edu/~shipman/soft/fontselect/
#----------------------------------------------------------------

import Tkinter as tk
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(tk.Frame):
    """GUI for fontselector

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