How to write wxPython textCtrl focus event
问题 I'm trying to fire a line of code when the user clicks on a textCtrl. The end goal is to highlight the contents of the box when it is clicked on. I am aware that this is possible with wx.EVT_SET_FOCUS, but it's either buggy or I'm implementing it wrong. Here's my code: self.m_textCtrl1 = wx.TextCtrl(self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(100,-1), wx.TE_LEFT) self.m_textCtrl1.SetMaxLength(8) self.m_textCtrl1.SetMinSize(wx.Size(100,-1)) self.m_textCtrl1.SetMaxSize