If arg is omitted, return the current state of the modified flag as true or false; the flag is set automatically whenever the text is inserted or deleted. Otherwise set the flag to the boolean arg.
tkinter/Text.edit_modified
Text.edit_modified