views:

159

answers:

2

I want to do some validation whenever the value of a textfield changes. I don't see an on change event mentioned in the documentation though.

+1  A: 

Pythoncard is built on wxPython, and wxPython has a text change event. I know nothing about Pythoncard, but in wxPython one would use:

    t1 = wx.TextCtrl(self, -1, "some text", size=(125, -1)) # to make the text control
    self.Bind(wx.EVT_TEXT, self.OnText, t1)   # your OnText method handles the event

For events, there's wx.EVT_TEXT, wx.EVT_CHAR, wx.EVT_TEXT_ENTER, and more details about these can be found in the wxPython docs, and also usage examples in the wxPython demo if you happen to have that. Also, wxPython has several types of the text entry controls, and I'm assuming that you're using the wxTextCtrl, though the docs should have info on the others as well.

tom10
cool beans thanks. I'll try to translate it to PythonCard.
Greg
+1  A: 

I think the textUpdate event is what your looking for.

http://pythoncard.sourceforge.net/framework/components/TextField.html

shsteimer