self text edit_reset(self text edit_modified( self knownencoding none clear undo/redo stks clear modified flag unicode type unknown def onquit(self)""on quit menu/toolbar select and wm border button in toplevel windows don' exit app if others changed don' ask if self unchangedmoved to the top-level window classes at the end since may vary per usagea quit in gui might quit(to exitdestroy(just one topleveltkor edit frameor not be provided at all when run as an attached componentcheck self for changesand if might quit()main windows should check other windows in the process-wide list to see if they have changed too""assert false'onquit must be defined in window-specific sublassdef text_edit_modified(self)"" this now worksseems to have been bool result type issue in tkinter self text edit_modified(broken in python do manually for now""return self text edit_modified(#return self tk call((self text _w'edit'('modified'none)###########################################################################edit menu commands ###########################################################################def onundo(self) trytk keeps undo/redo stacks self text edit_undo(exception if stacks empty except tclerrormenu tear-offs for quick undo showinfo('pyedit''nothing to undo'def onredo(self) redo an undone tryself text edit_redo(except tclerrorshowinfo('pyedit''nothing to redo'def oncopy(self)get text selected by mouseetc if not self text tag_ranges(sel)save in cross-app clipboard showerror('pyedit''no text selected'elsetext self text get(sel_firstsel_lastself clipboard_clear(self clipboard_append(textdef ondelete(self)delete selected textno save if not self text tag_ranges(sel)showerror('pyedit''no text selected'elseself text delete(sel_firstsel_lastpyedita text editor program/object