(self, event=None)
If entry is valid, bind it to 'result' and destroy tk widget.

        Otherwise leave dialog open for user to correct entry or cancel.
If entry is valid, bind it to 'result' and destroy tk widget.
If entry is valid bind it to result and destroy tk widget .
def ok(self, event=None):  # Do not replace.
        '''If entry is valid, bind it to 'result' and destroy tk widget.

        Otherwise leave dialog open for user to correct entry or cancel.
        '''
        self.entry_error['text'] = ''
        entry = self.entry_ok()
        if entry is not None:
            self.result = entry
            self.destroy()
        else:
            # [Ok] moves focus.  (<Return> does not.)  Move it back.
            self.entry.focus_set()
def ok ( self , event = None ) : # Do not replace. self . entry_error [ 'text' ] = '' entry = self . entry_ok ( ) if entry is not None : self . result = entry self . destroy ( ) else : # [Ok] moves focus.  (<Return> does not.)  Move it back. self . entry . focus_set ( )