Is this just my local build, or is anyone else seeing this as well? I can not get any EVT_KILL_FOCUS events to trigger from spin controls. Here is a little sample code with a text control and a spin control. The event fires for the text control, but never for the spin control.
Thanks!
#!/usr/bin/env python
# generated by wxGlade 0.3.2 on Mon May 3 12:45:08 2004
import wx
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.spin_ctrl_1 = wx.SpinCtrl(self, -1, "", min=0, max=100)
self.text_ctrl_1 = wx.TextCtrl(self, -1, "")
self.__set_properties()
self.__do_layout()
# end wxGlade
self.__set_events()
def __set_events(self):
wx.EVT_KILL_FOCUS(self.text_ctrl_1, self.t1)
wx.EVT_KILL_FOCUS(self.spin_ctrl_1, self.s1)
def t1(self, evt):
print "t1 lost focus"
def s1(self, evt):
print "s1 lost focus"
def __set_properties(self):
# begin wxGlade: MyFrame.__set_properties
self.SetTitle("frame_1")
self.SetSize((160, 110))
# end wxGlade
def __do_layout(self):
# begin wxGlade: MyFrame.__do_layout
sizer_1 = wx.BoxSizer(wx.VERTICAL)
sizer_1.Add(self.spin_ctrl_1, 0, wx.ALL, 10)
sizer_1.Add(self.text_ctrl_1, 0, wx.ALL, 10)
self.SetAutoLayout(1)
self.SetSizer(sizer_1)
self.Layout()
# end wxGlade
# end of class MyFrame
class MyApp(wx.App):
def OnInit(self):
wx.InitAllImageHandlers()
frame_1 = MyFrame(None, -1, "")
self.SetTopWindow(frame_1)
frame_1.Show(1)
return 1
# end of class MyApp
if __name__ == "__main__":
app = MyApp(0)
app.MainLoop()