Hi All:
Long time no post and all that, hope everyone is well! :-)
I'm having an odd problem with the latest round of enhancements for the
standaloneBuilder tool which I'd appreciate any input on that may be
forthcoming.
Platform details first...I'm running Mandriva 2007.0, Python 2.4.3,
wxPython 2.6.3.3 and PythonCard 0.8.2 on my Linux machine and XP Pro,
Python 2.4.3, wxPython 2.8.4.0 and PythonCard 0.8.2 on my Windows box.
If you change some aspect of a standaloneBuilder project and then try to
close the program without saving the project, it throws up a 'Project
not saved, save now?' dialog with yes, no and cancel buttons. Within the
code, this is handled by the 'on_close' event:
def on_close(self, event):
if self.doExit():
print 'on_close: calling event.Skip()'
event.Skip()
print 'on_close: back from event.Skip()'
the doExit() routine looks like this:
def doExit(self):
bull = True
if self.documentChanged:
save = self.saveChanges()
if save == wx.ID_CANCEL:
bull = False
elif save == wx.ID_NO:
bull = True
else:
if self.documentPath is None:
bull = self.on_menuFileSaveAs_select(None)
else:
self.saveFile(self.documentPath)
bull = True
print 'doExit: returning [%s]' % bull
return bull
On my Linux box, I make a change to the project file then try to exit
the program and select 'No' when it asks me if I want to save the
changes. The main window then disappears but the program is still
running. From the print statements I've put into the code, at the point
where the on_close event fires, the event.Skip() appears to be getting
ignored, and in my terminal window, I see both print lines, i.e
on_close: calling event.Skip()
on_close: back from event.Skip()
Under Windows, everything works as it is supposed to and the program
exits cleanly back to a command prompt.
On both Linux and Windows, clicking the 'yes' and 'cancel' buttons
results in the expected behaviour, it's just clicking 'no' that seems to
break things on Linux. I've checked an earlier version of
standaloneBuilder and this has the same bug, so I'm reasonably sure this
isn't something that I've introduced into the code by my recent changes.
I'm planning to install a later version of wxPython on another machine
and repeat my test there to try to rule out any bug in wx that my code
might be tickling.
My understanding of the event.Skip() call is that it simply leaves the
current event unchanged and allows it to pass back 'up the chain' to be
dealt with elsewhere. It seems as though my code is somehow swallowing
the on_close event.
Any ideas?
--
Regards
Phil Edwards
Brighton, UK
|