[wxpython-users] Catching user leaving the window - solved (mostly)

Werner F. Bruhin werner.bruhin at free.fr
Tue Sep 9 05:12:45 PDT 2008


Instead of using an event I changed it to use pubsub and keep track of 
this in my app module, then on the appropriate actions a user can take I 
call a method in my app module which checks if data is to be saved, if 
yes a message dialog is shown given the user the option to return and 
save the data or to discard the data (rollback).

Only problem I have is that there many unnecessary events generated 
setting the flag to data needs saving.  Lots were cased by my 
validator.TransferToWindow methods.  Changed most from using SetValue to 
ChangeValue, but there are still some controls which don't allow that 
(will do a new thread on that), so need to reset the flag after loading 
data.

Thanks to Robin, Mike and Tim who pushed me in the right direction.
Werner


More information about the wxpython-users mailing list