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

11. class Application: The outermost frame

This class encapsulates the entire graphical application. It inherits from Tkinter's Frame class, which makes Application for all intents and purposes a Tkinter widget.

huey
# - - - - -   c l a s s   A p p l i c a t i o n

class Application(Frame):
    """Contains the entire application.

      Contained widgets:
        .menuBar:       [ a MenuBar widget ]
        .namePicker:    [ a NamePicker widget ]
        .adjuster:      [ an Adjuster widget ]
        .swatch:        [ a Swatch widget ]

      Grid plan:
         0             1           2
        +---------------+-------------+-----------+
      0 | .__menuBar                              |
        +---------------+-------------+-----------+
      1 | .__namePicker | .__adjuster | .__swatch |
        +---------------+-------------+-----------+
    """

This class is a container for four compound widgets. The MenuBar widget across the top edge contains general controls for the application. The bulk of the space is taken up by the three major sections of the application: the NamePicker widget for selecting colors by name; the Adjuster widget for adjusting colors and selecting color models; and the Swatch widget displaying the selected colors and fonts, and including font selection controls.

At this level, there are only two important linkages between the contained widgets:

The current text and background colors reside inside the Adjuster widget.