wxTextCtrl lost focus validation

Hi all:
    I see,I see.Change the code self.t1.SetFocus() to
wx.CallAfter(self.t1.SetFocus),it may work well.

   def onKillFocus(self, event):
        
        if self.t1.GetValue() <> 'ADMIN':
            wx.MessageBox('User not exist.' , 'Error', wx.OK)
# self.t1.SetFocus()
            wx.CallAfter(self.t1.SetFocus)

        event.Skip()

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/wxTextCtrl-lost-focus-validation-tp4263598p4263616.html
Sent from the wxPython-users mailing list archive at Nabble.com.