O'Reilly logo

Tkinter GUI Application Development Blueprints - Second Edition by Bhaskar Chaudhary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Focus-out validation mode demo

The previous example demonstrated validation in the key mode. This means that the validation method was called after every keypress to check whether an entry was valid.

However, there are situations where you might want to check the entire string entered into the widget rather than checking individual keystroke entries.

For example, when an Entry widget accepts a valid email address, we would ideally like to check the validity after the user has entered the entire email address and not after every keystroke entry. This will qualify for a validation in the focusout mode.

Check out 10.06_focus_out_validation.py for a demonstration of email validation in the focusout mode, which gives us the following GUI:

The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required