Search code examples
wxpython

Reading data from the widget in wxpython


Simple GUI

I am wondering how to read the data of start Address and End Address from the TextCtrl box once I click the OK button in the picture attached.


Solution

  • You would need to call each of the text control's GetValue() methods. 'GetValue()` returns whatever is in the text control.

    So let's say that the start address text control is called self.start_address. In you button's handler, you would do something like this:

    def on_ok(self, event):
        start_address = self.start_address.GetValue()