Under some circumstances, you might want to perform an action before the user closes a top-level window, for instance, to prevent you losing unsaved work. Tkinter allows you to intercept this type of event to conditionally destroy the window.
Under some circumstances, you might want to perform an action before the user closes a top-level window, for instance, to prevent you losing unsaved work. Tkinter allows you to intercept this type of event to conditionally destroy the window.