[Boa Constr] save dialog issues
Status: Beta
Brought to you by:
riaan
From: Steven D. A. <st...@ne...> - 2000-12-01 05:01:48
|
Hi, I am playing with Boa Constructor, picking minor problems and trying to fix them. The issue I'm dealing with now is this: when you click the "Package" button, you get a save dialog; however, if you click "Cancel," the dialog does not necessarily go away. Often I have to click cancel a dozen times or more before the dialog disappears. I isolated the problem to the following function: def saveAsDlg(self, filename, filter = '*.py'): dir, name = path.split(filename) dlg = wxFileDialog(self, 'Save as...', dir, name, filter, wxSAVE | wxOVERWRITE_PROMPT) try: print "getting ready to execute showmodal" if dlg.ShowModal() == wxID_OK: print "showmodal returned wxID_OK" return dlg.GetPath(), true else: print "showmodal did not return wxID_OK" return '', false finally: dlg.Destroy() It looks like wxFileDialog and ShowModal are being called correctly. However, the console prints the following: 6 C:\boa getting ready to execute showmodal 6 C:\boa getting ready to execute showmodal 6 C:\boa getting ready to execute showmodal 6 C:\boa getting ready to execute showmodal 6 C:\boa getting ready to execute showmodal 6 C:\boa getting ready to execute showmodal 6 C:\boa getting ready to execute showmodal 6 C:\boa getting ready to execute showmodal 6 C:\boa getting ready to execute showmodal 6 C:\boa getting ready to execute showmodal 6 C:\boa getting ready to execute showmodal 6 C:\boa getting ready to execute showmodal showmodal did not return wxID_OK showmodal did not return wxID_OK showmodal did not return wxID_OK showmodal did not return wxID_OK showmodal did not return wxID_OK showmodal did not return wxID_OK showmodal did not return wxID_OK showmodal did not return wxID_OK showmodal did not return wxID_OK showmodal did not return wxID_OK showmodal did not return wxID_OK showmodal did not return wxID_OK In short, it looks like we never got out of the ShowModal call; each time I clicked on the cancel button, it's as if a new thread were started calling the SaveAsDlg function. Anyone have any idea what's going on here? -- Steven D. Arnold Que quiero sera st...@ne... "He was part of my dream, of course -- but then I was part of his dream too." -- Lewis Carroll |