self actionbuttons(for (labelcallbackin myactionsb button(actionsframetext=labelcommand=callbackb config(bg='beige'relief=ridgebd= pack(side=topexpand=yesfill=bothbody textpack last=clip first self editor pack(side=bottommay be multiple editors self update( else may be line self editor setalltext(showtexteach has own content lines len(showtext splitlines()lines min(lines mailconfig viewheight or self editor setheight(lineselse height= width= self editor setwidth( or from pyedit textconfig if mailconfig viewbgself editor setbg(mailconfig viewbgcolorsfont in mailconfig if mailconfig viewfgself editor setfg(mailconfig viewfgif mailconfig viewfontalso via editor tools menu self editor setfont(mailconfig viewfontdef makeheaders(selfheadermap)""add header entry fieldsreturn action buttons frame uses grid for platform-neutral layout of label/entry rowspacked row frames with fixed-width labels would work well too decoding of headers (and email names in address headersis performed here if still required as they are added to the guisome may have been decoded already for reply/forward windows that need to use decoded textbut the extra decode here is harmless for theseand is required for other headers and cases such as fetched mail viewsalwaysheaders are in decoded form when displayed in the guiand will be encoded within mailtools on sends if they are non-ascii (see write) header decoding also occurs in list window mail indexesand for headers added to quoted mail texttext payloads in the mail body are also decoded for display and encoded for sends elsewhere in the system (list windowswrite) creators of edit windows prefill bcc header with sender email address to be picked up hereas convenience for common usages if this header is enabled in mailconfigreply also now prefills the cc header with all unique original recipients less fromif enabled""top frame(self)top pack (side=topfill=xleft frame(top)left pack (side=leftexpand=nofill=bothmiddle frame(top)middle pack(side=leftexpand=yesfill=xheaders set may be extended in mailconfig (bccothers?self userhdrs (showhdrs ('from''to''cc''subject'if hasattr(mailconfig'viewheaders'and mailconfig viewheadersself userhdrs mailconfig viewheaders showhdrs +self userhdrs addrhdrs ('from''to''cc''bcc' decode specially pymailgui implementation