Validate the data entered by the user. Return true if it is valid, in which case the dialog proceeds to apply(); return false to keep the dialog open. The default implementation always returns true; override it to check the input.
tkinter.simpledialog/Dialog.validate
Dialog.validate