I asked that in another thread, but it got lost:
When do you use root.quit() and when do you use root.destroy() to exit a Tkinter program?
Also, can you intercept an exit when you use the little x in the title bar, just to affirm that you really want to exit, or you in case you should save data as a file before you exit.