variable but the clipboard is actually much larger concept the clipboard used by this script is an interface to system-wide storage spaceshared by all programs on your computer because of thatit can be used to transfer data between applicationseven ones that know nothing of tkinter for instancetext cut or copied in microsoft word session can be pasted in simpleeditor windowand text cut in simpleeditor can be pasted in microsoft notepad window (try itby using the clipboard for cut and pastesimpleeditor automatically integrates with the window system at large moreoverthe clipboard is not just for the text widget--it can also be used to cut and paste graphical objects in the canvas widget (discussed nextas used in the script of example - the basic tkinter clipboard interface looks like thisself clipboard_clear(self clipboard_append(texttext self selection_get(selection='clipboard'clear the clipboard store text string on it fetch contentsif any all of these calls are available as methods inherited by all tkinter widget objects because they are global in nature the clipboard selection used by this script is available on all platforms ( primary selection is also availablebut it is only generally useful on windowsso we'll ignore it herenotice that the clipboard selection_get call throws tclerror exception if it failsthis script simply ignores it and abandons paste requestbut we'll do better later composition versus inheritance as codedsimpleeditor uses inheritance to extend scrolledtext with extra buttons and callback methods as we've seenit' also reasonable to attach (embedgui objects coded as componentssuch as scrolledtext the attachment model is usually called compositionsome people find it simpler to understand and less prone to name clashes than extension by inheritance to give you an idea of the differences between these two approachesthe following sketches the sort of code you would write to attach scrolledtext to simpleeditor with changed lines in bold font (see the file simpleedit py in the book' examples distribution for complete composition implementationit' mostly matter of passing in the right parents and adding an extra st attribute name anytime you need to get to the text widget' methodsclass simpleeditor(frame)def __init__(selfparent=nonefile=none)frame __init__(selfparentself pack(frm frame(selffrm pack(fill=xbutton(frmtext='save'command=self onsavepack(side=leftmore text