- The bulk of this window (its entire lower portion) is just another reuse of the
TextEditor class object of the PyEdit program we wrote in Chapter 11—PyMailGUI
simply attaches an instance of TextEditor to every view and compose window in
order to get a full-featured text editor component for free. In fact, much on the
window shown in Figure 14-5 is implemented by TextEditor, not by PyMailGUI.
Reusing PyEdit’s class this way means that all of its tools are at our disposal for email
text—cut and paste, find and goto, saving a copy of the text to a file, and so on. For
instance, the PyEdit Save button at the bottom left of Figure 14-5 can be used to save
just the main text of the mail (as we’ll see later, clicking the leftmost part button in the
middle of the screen affords similar utility, and you can also save the entire message
from a list window). To make this reuse even more concrete, if we pick the Tools menu
of the text portion of this window and select its Info entry, we get the standard PyEdit
TextEditor object’s text statistics box shown in Figure 14-6—the same pop up we’d
get in the standalone PyEdit text editor and in the PyView image view programs we
wrote in Chapter 11.
In fact, this is the third reuse of TextEditor in this book: PyEdit, PyView, and now
PyMailGUI all present the same text-editing interface to users, simply because they all
use the same TextEditor object and code. PyMailGUI uses it in multiple roles—it both
attaches instances of this class for mail viewing and composition, and pops up instances
in independent windows for some text mail parts, raw message text display, and Python
Figure 14-4. PyMailGUI HTML help display (new in 3.0)
1024 | Chapter 14: The PyMailGUI Client