[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版

(yzsuai) #1

PyMailGUI’s list windows, such as the one in Figure 14-1, display mail header details
in fixed-width columns, up to a maximum size. Mails with attachments are prefixed
with a “*” in mail index list windows, and fonts and colors in PyMailGUI windows like
this one can be customized by the user in the mailconfig configuration file. You can’t
tell in this black-and-white book, but most of the mail index lists we’ll see are configured
to be Indian red, view windows are light blue, pop-up PyEdit windows are beige instead
of PyEdit’s normal light cyan, and help is steel blue. You can change most of these as
you like, and PyEdit pop-up window appearance can be altered in the GUI itself (see
Example 8-11 for help with color definition strings, and watch for alternative config-
uration examples ahead).


List windows allow multiple messages to be selected at once—the action selected at
the bottom of the window is applied to all selected mails. For instance, to view many
mails, select them all and press View; each will be fetched (if needed) and displayed in
its own view window. Use the All check button in the bottom right corner to select or
deselect every mail in the list, and Ctrl-Click and Shift-Click combinations to select
more than one (the standard Windows multiple selection operations apply—try it).


Before we go any further, though, let’s press the help bar at the top of the list window
in Figure 14-1 to see what sort of help is available; Figure 14-2 shows the text-based
help window pop up that appears—one of two help flavors available.


The main part of this window is simply a block of text in a scrolled-text widget, along
with two buttons at the bottom. The entire help text is coded as a single triple-quoted
string in the Python program. As we’ll see in a moment, a fancier option which opens


Figure 14-1. PyMailGUI main server list window


A PyMailGUI Demo| 1021
Free download pdf