Howdy y'all,
I don't usually yell about bugs when something strange happens, but this one
is quite peculiar...
In one of my applications I call (create, call and destroy) a
wxSingleChoiceDialog twice. I just got a new computer, installed wxPython-
2.3.0, and started the application. To my surprise, the app hangs after
showing (and destroying) the first dialog. The second one doesn't show up,
and the application just sits there idly.
Of course, it's possible that I'm doing something wrong, but this used to
work on my previous computer.
Here's the data:
Current computer: Windows XP (oy vey), Python 2.1, wxPython-2.3.0 (just
upgraded to 2.3.1 which shows the same result).
Previous computer: Windows 98, Python 2.0, wxPython-2.3.0 (I think, could
have been 2.2.5 or so).
It could be a Windows XP "feature", I don't know much about that.
The following code reproduces the behavior, at least on my machine:
#--begin
# wxtest.py
from wxPython.wx import *
def pickccg(frame):
ccglist = ["1", "2", "3"]
dlg = wxSingleChoiceDialog(frame, 'Pick a CCG:', 'Pick a CCG', ccglist)
if dlg.ShowModal() == wxID_OK:
result = dlg.GetStringSelection()
else:
result = ""
dlg.Destroy()
return result
def pickuser(frame, ccg):
ccglist = ["a", "b", "c"]
dlg = wxSingleChoiceDialog(frame, 'Pick a CCG:', 'Pick a CCG', ccglist)
if dlg.ShowModal() == wxID_OK:
result = dlg.GetStringSelection()
else:
result = ""
dlg.Destroy()
return result
class MyApp(wxApp):
def OnInit(self):
ccg = pickccg(NULL)
user = pickuser(NULL, ccg)
print ccg, user
return true
app = MyApp(0)
app.MainLoop()
#--end
It does work with only one dialog, but not with two. <scratches head>
Ideas, anyone?