Hi list,
Something weird is happening in my application (Python 2.3.3, wxPython
2.4.2.4):
If I close the main window (click the cross in the upper right corner) of my
application, the OnExit of the application is not executed, and the
application is not closed. This means that an instance of the application is
still active, but no screens are visible.
Furthermore, if I execute self.Close in the main window, nothing happens.
here is the relevant part of my application:
----------- snip -----------------
class cvs(wxApp):
def __init__(self, su):
self.su = su
wxApp.__init__(self)
def OnInit(self):
wxBeginBusyCursor()
self.SetAppName('Client Volgsysteem')
self.SetVendorName('Lindix BV. Almere (c) 2003, 2004')
self.config = Getenv.Config(su=self.su)
self.p = Opendb.create(self.config)
self.config.CurrUser = Getuser.CurrUser(self.config)
self.p.OpenDatabase(self.config)
BusinessRules.Business_Fldrules()
self.config.CurrUser.GetUserEnvironment()
self.p.Filters.InitFilters()
self.hf=Hoofdframe.create(self.config)
self.SetTopWindow(self.hf)
wxEndBusyCursor()
return True
def OnExit(self):
if hasattr(Opendb.TableObjs, 'wp'):
Opendb.TableObjs.wp.SaveDocuments(Afsluiten=True)
Opendb.TableObjs.wp.CloseDocuments()
self.config.CurrUser.UserUpdate()
self.config.WriteUserConfig()
self.config.Cached.WriteCache()
self.config.ExitApplicatie()
if __name__ == '__main__':
if len(sys.argv) > 1:
if sys.argv[1] <> '--superuser':
print "Ongeldige parameter. Alleen --superuser is toegestaan...."
sys.exit()
else: su = True
else: su = False
os.chdir(os.path.normpath(os.path.dirname(sys.argv[0])))
cvsapp = cvs(su)
cvsapp.MainLoop()
----------- snip -----------------
Because the problem occurred after I added an extra "password screen" which is
presented in "self.p.OpenDatabase(self.config)", I thought that the TopWindow
was not defined properly, and so I added self.SetTopWindow.
However, the problem still persists.
Any help would be appreciated
Cheers.
D.Kniep