Search code examples
pythonfocuswxpython

wxPython: Find the focused wxTextCtrl?


I am new to wxPython and trying out some examples. I am using wxFormBuilder to create a simple GUI with many wxTextCtrl. I want to determine the current location of cursor, which is in one of those wxTextCtrl and do some operation. How do I do this? Please help!


Solution

  • Try using the wx.Frame's FindFocus() method. That should return the widget that has focus.

    See also: