Hi Geoff, On Tue, 26 Jan 2010 13:45:49 +0100 Geoff Bache <geoff.ba...@gmail.com> wrote:
(...) > Hi Michael, > > Yes, I'd seen that, but it doesn't really fit the criteria of being > independent of how > it's closed. As far as I can see it will get called when the window's > close button > is pressed, and nothing else, so if the application itself calls > "destroy", it won't actually get called. > > Why doesn't it work to bind to "<Destroy>" like I did? That seemed > the intuitive way to go, and it seems to work on Linux... > I don't have a windows box at hand, so I cannot tell. On my linux box it works, but when I bind the callback to the root tk window the callback is triggered once for every child widget of root. > (To explain some more, I'm still on my GUI testing effort from my > previous question > and am trying to handle window closures. So another potential solution > would be if > there was some way to simulate the actual window closure and > programmatically trigger the window to be closed in the window > manager. But I couldn't see a way to > do that. So the next best thing for me was to use <Destroy> and > exclude programmatic > calls via interception.) > Just a thought... IIRC last time I suggested to override mainloop(); if this is an option you could put your "destroy" callback into the custom mainloop() function, below self.tk.mainloop(n). Regards Michael _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org http://mail.python.org/mailman/listinfo/tkinter-discuss