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.
# - - - - - 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:
Whenever the user selects a color in the NamePicker widget, that widget tells the
Adjuster widget to display that color.
Whenever the user adjusts the current color in the
Adjuster widget, or when that widget
is set by an outside call to change its color, it
tells the Swatch widget to change to
the new color as well.
The current text and background colors reside
inside the Adjuster widget.