text with scrollbar view text config(height= width= config text in frame view text config(font=('courier' 'normal')use fixed-width font new title("text viewer"set window mgr attrs new iconname("browser"file text added auto ""def browser(selffilename)new toplevel(text scrolledtext(newheight= width= text config(font=('courier' 'normal')text pack(expand=yesfill=bothnew title("text viewer"new iconname("browser"text insert(' 'open(filename' 'read(""if tkinter scrolledtext included for reference if __name__ ='__main__'class testmixin(guimixinframe)standalone test def __init__(selfparent=none)frame __init__(selfparentself pack(button(selftext='quit'command=self quitpack(fill=xbutton(selftext='help'command=self helppack(fill=xbutton(selftext='clone'command=self clonepack(fill=xbutton(selftext='spawn'command=self otherpack(fill=xdef other(self)self spawn('guimixin py'spawn self as separate process testmixin(mainloop(although example - is geared toward guisit' really about design concepts the guimixin class implements common operations with standard interfaces that are immune to changes in implementation in factthe implementations of some of this class' methods did change--between the first and second editions of this bookold-style dialog calls were replaced with the new tk standard dialog callsin the fourth editionthe file browser was updated to use different scrolled text class because this class' interface hides such detailsits clients did not have to be changed to use the new techniques as isguimixin provides methods for common dialogswindow cloningprogram spawningtext file browsingand so on we can add more methods to such mixin later if we find ourselves coding the same methods repeatedlythey will all become available immediately everywhere this class is imported and mixed moreovergui mixin' methods can be inherited and used as isor they can be redefined in subclasses such are the natural advantages of classes over functions guimixincommon tool mixin classes