Hi, I'm having some troubles...
Take the example program here:
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
wx.Frame.__init__(self, None, -1, "test")
self.cb = wx.ComboBox(self, -1, style = wx.CB_READONLY)
self.cb.Bind(wx.EVT_COMBOBOX, self.OnEvent)
self.cb.Append("Blurb")
self.cb.SetValue("Blurb")
self.cb.Delete(0)
print self.cb.GetValue()
self.cb.Append("bla")
def OnEvent(self, event):
print 'CB_EVENT'
print self.cb.GetValue()
class Application(wx.App):
def OnInit(self):
win = MyFrame(None, -1, "")
win.Show(True)
return True
# end of class MyFrame1
app = Application(0)
app.MainLoop()
Run it, and select the only entry in the combobox, and exit.
In my opinion, the outputput should be
"" (i.e. nothing selected)
CB_EVENT
Bla
But the output I get:
Blurb
This not only means, that the first print produces a wrong result (The
checkbox is empty, thus GetValue should return such), and second, I'm not
receiving the Checkbox event, because I don't get the CB_EVENT.
Any idea what causes this?
May be it's os-specific. I'm on Windows XP
Thanks