I have a textCTRL
(Wxpython) with event binding to it:
self.x= wx.TextCtrl(self, -1, "")
self.x.Bind(wx.EVT_KILL_FOCUS, self.OnLeavex)
I want to manually trigger this event as I wish. I read this topic: wxPython: Calling an event manually but nothing works.
I tried:
wx.PostEvent(self.x.GetEventHandler(), wx.EVT_KILL_FOCUS)
But it gives:
TypeError: in method 'PostEvent', expected argument 2 of type 'wxEvent &'
I also tried:
self.x.GetEventHandler().ProcessEvent(wx.EVT_KILL_FOCUS)
Which doesn't work as well.