每次文本ctrl输入完成时如何触发事件?
How to trigger event every time text ctrl input complete?
我有一个文本 ctrl 定义为:
self.item= wx.TextCtrl(self, -1, "",style=wx.TE_LEFT)
用户在那里输入数字。
我希望当他完成时(比如焦点已更改到其他地方)将触发一个事件。
什么事件可以做到这一点?
绑定此事件:
self.item.Bind(wx.EVT_KILL_FOCUS, self.OnLoseFocus)
然后通过以下方式捕捉事件:
def OnLoseFocus(self,event):
do actions...
event.Skip()
我有一个文本 ctrl 定义为:
self.item= wx.TextCtrl(self, -1, "",style=wx.TE_LEFT)
用户在那里输入数字。 我希望当他完成时(比如焦点已更改到其他地方)将触发一个事件。
什么事件可以做到这一点?
绑定此事件:
self.item.Bind(wx.EVT_KILL_FOCUS, self.OnLoseFocus)
然后通过以下方式捕捉事件:
def OnLoseFocus(self,event):
do actions...
event.Skip()