Hey list,
My app continues to come along nicely, but I’ve seen a random problem off and on and I think I’ve isolated part of the cause: the wx version. At work, I’m on 3.0.2, but at home, I somehow managed to get 3.0.3. They’re different enough that I’m getting deprecation warnings, and I have to do a couple different calls based on the version string. That’s all fine, but shows that I definitely have a different version at home than on my work machine.
The issue is that my app will sometimes freeze up completely at home (3.0.3), but I haven’t seen that happen at all at work (3.0.2). Yes, I could downgrade to 3.0.2 at home, but I do hope to support updates to WX as they come out, so I’d like to solve this instead of ducking it.
Right now, I can consistently freeze my app after clicking ‘yes’ or ‘no’ in a wx.MessageDialog. Immediately after that dialog’s ShowModal() call, I check if the result was wx.ID_YES. If it was, I print a line, grab a value from a stored list, print another line, and that’s it. I have no statement to detect wx.ID_NO at all. Yet, no matter what I click, my app locks up and I have to force-quit it. My initial print statement appears if I click yes, but nothing else. I even removed the other two lines, so the only thing that should happen upon clicking ‘yes’ is a single print statement, but the app still locks up completely.
I can’t test this new dialog/freezing thing at work until Monday, but earlier in the week, my app froze up at different times just like this. Running the same things at work produced no freezing, making me think the wx version is somehow the problem. It could be something in my app, of course, I don’t know. It just seems suspicious that freezes only happen under 3.0.3. Other than the wx version, both machines have the same Python version and other dependencies installed, and both are on Windows 7x64. Oh, and another dialog–a full wx.Dialog, not wx.MessageDialog–works perfectly at home, without freezing anything. Is there something in 3.0.3 for MessageDialogs that I have to handle? I typed the below sample free-hand on a different machine, so any typos are mine here, not actually in my code.
def deleteSelectedRecord(self, eat):
shouldDelete_dialog = wx.MessageDialog(self, “Are you sure you want to delete this record from the database?”, “Delete Record?”, wx.YES_NO|wx.NO_DEFAULT|wx.ICON_QUESTION)
shouldDelete = shouldDelete_dialog.ShowModal()
if shouldDelete == wx.ID_YES:
print “should delete” #this usually prints before the app locks up
shouldDelete_dialog.Destroy()