def ok(self, event=None):
if not self.check_input():<EOL><INDENT>self.initial_focus.focus_set()<EOL>return<EOL><DEDENT>self.withdraw()<EOL>self.update_idletasks()<EOL>try:<EOL><INDENT>self.execute()<EOL><DEDENT>finally:<EOL><INDENT>self.cancel()<EOL><DEDENT>
Function called when OK-button is clicked.

        This method calls check_input(), and if that returns ok it calls
        execute(), and then destroys the dialog.