[Newbie] Tkinter Question

Wildman best_lay at yahoo.com
Tue Feb 23 17:19:43 EST 2016


I am familiar with OO programming but I am new to Python
and Tkinter.  I am working on a gui program that creates
a couple of temporary files.  As part of the Exit button
command they are deleted.  If the program is shut down
using the window close button [X], the exit button code
is not executed and the temporary files are left behind.
That is a serious no-no.

Is there a way to capture close button click to prevent
the program from closing and instead execute a command?
I'm talking about something like the Form_QueryUnload
event in Visual Basic.

Alternately is there a way to just disable the button
or prevent it from being displayed in the first place?

Any help appreciated.

-- 
<Wildman> GNU/Linux user #557453
"Be at war with your vices, at peace with your neighbors,
and let every new year find you a better man."
  -Benjamin Franklin



More information about the Python-list mailing list