While I'm a user, I'm not a guru. Those are at: https://lists.sourceforge.net/lists/listinfo/pythoncard-users for pythoncard.
I know a common technique is on a button event for the "ok" or "apply" button is to validate all the text fields in an exception safe setting. On exception exit the event handler make an error notice. You could even color the guilty text box text red then exit the event handler. Only if all the boxes make it through, do you actually process the input. GUI code often is...hairy...when done correctly. That's why is should be separated into its own files: to keep the hair out of your main program. --Michael On Dec 24, 2007 10:02 AM, Roy Chen <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I've just started trying PythonCard to build a simple GUI for a little > application I'm writing. > Just wondering if anyone knows the "proper" way to do some simple error > checking: > for example, I have a textField, and I wish to check that only integers > within a certain > range are entered into it. > > I know I can just enclose that block of code in a try .. except clause, > just that I'm not sure > what to do once I've caught say, a ValueError exception. It certainly > would not be a fatal > error and I would like to prompt the user to re-enter the value, but how > should I return to > that point of program execution? > > Any help from the PythonCard gurus would be appreciated. Happy holidays! > > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > > -- Michael Langford Phone: 404-386-0495 Consulting: http://www.RowdyLabs.com
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor