Note that PyMailGUI is really meant to be a multiple-window interface—a detail not made obvious by the earlier screenshots. For example, Figure 15-36 shows PyMailGUI with the main server list window, two save-file list windows, two message view windows, and help. All these windows are nonmodal; that is, they are all active and independent, and do not block other windows from being selected. This interface looks slightly different on Linux and the Mac, but it has the same functionality.
Figure 15-36. PyMailGUI multiple windows and text editors
In general, you can have any number of mail view or compose windows up at once, and cut and paste between them. This matters, because PyMailGUI must take care to make sure that each window has a distinct text-editor object. If the text-editor object were a global, or used globals internally, you’d likely see the same text in each window (and the Send operations might wind up sending text from another window). To avoid this, PyMailGUI creates and attaches a newTextEditorinstance to each view and compose window it creates, and associates the new editor with the Send button’s callback handler to make sure we get the right text.
Finally, PyMailGUI prints a variety of status messages as it runs, but you see them only if you launch the program from the system command-line console window (e.g., a DOS box on Windows or an xterm on Linux), or by double-clicking on its filename icon (its main script is a .py, not a .pyw). On Windows, you won’t see these messages when PyMailGUI is started from another program, such as the PyDemos or PyGadgets launcher bar GUIs. These status messages print server information, show mail loading status, and trace the load, store, and delete threads that are spawned along the way. If you want PyMailGUI to be more verbose, launch it from a command line and watch:
C:\...\PP3E\Internet\Email\ PyMailGui>PyMailGui2.py user: pp3e loading headers Connecting... +OK NGPopper vEL_6_10 at earthlink.net ready<firstname.lastname@example.org. earthlink.net> load headers exit synch check Connecting... +OK NGPopper vEL_6_10 at earthlink.net ready <email@example.com. earthlink.net> Same headers text load 16 Connecting... +OK NGPopper vEL_6_10 at earthlink.net ready <firstname.lastname@example.org. earthlink.net> Sending to...['email@example.com'] From: firstname.lastname@example.org To: email@example.com Subject: Fwd: Re: America MP3 file Date: Mon, 06 Feb 2006 07:41:05 -0000 X-Mailer: PyMailGUI 2.1 (Python)
You can also double-click on the PyMailGui.py filename in your file explorer GUI and monitor the popped-up DOS console box on Windows. Console messages are mostly intended for debugging, but they can also be used to help understand the system’s operation.
For more details on using PyMailGUI, see its help display, or read the help string in the modulePyMailGuiHelp.py, listed in Example 15-9 in the next section.