title: TypeError: destroy() missing 1 required positional argument: 'event'
body: <p>Hi I keep getting the error above at tkinter.  </p>
  
  <p>I kept searching in the __init__.py of <em>tkinter</em> and destroy doesn't seem to be getting 2 arguments (so no <em>event</em> is needed).</p>
  
  <p>This is invoked when tkinter is trying to destroy a custom class that I have created which is a subclass of Frame.</p>
  
  <p>Before I added this class to the main window, the <code>root.destroy()</code>  ,<em>where root in that case is the main window</em>, was working fine.<br>
  After the addition of the custom class, it destroys only a part of the custom class and then (when probably tries to destroy the other part) it throws that error and does not destroy the root window.</p>
  
  <p>The code for the custom class is:</p>
  
  <pre><code>class inputBox(tk.Frame):
      def __init__(self, root, parentWindow, attrName, label, valueType, query=None ):
          super().__init__(root)
          self.attrName = attrName
          self.label = tk.Label(self,text=label)
          self.valueType = valueType
  
          if 'enum' in valueType:
              values = valueType.replace("enum(","").replace(")","").split(",")
  
          elif 'varchar' in valueType:
              maxChars = int(valueType.replace("varchar(","").replace(")",""))
              if query:
                  self.query=query
                  success,result = DAO().executeQuery(query,'select')
                  self.autoCompletedEntry = AutocompletedEntry(self, result, parentWindow, listboxLength=6, width = maxChars)
                  self.label.pack()
                  self.autoCompletedEntry.pack()
  </code></pre>
  
  <p>The code for the AutocompletedEntry (<strong>which is the class that probably creates the error</strong>) is:</p>
  
  <pre><code>class AutocompletedEntry(tk.Frame):
      #rootsParent is needed only for the popup autocompletion list
      def __init__(self, root, autocompleteList, rootsParent, *args, **kwargs):
          super().__init__(root)
  
          self.rootsParent = rootsParent
          self.var = tk.StringVar(self)
          self.var.trace("w", self.changed)#lambda name, index, mode, self.var=self.var: callback(self.var))
  
  
          if 'width' in kwargs:
              self.width = int(int(kwargs['width'])//3)
              del kwargs['width']
              if self.width &gt;40:
                  self.width = 40
          else:
              self.width = 25
  
          self.entry = tk.Entry(self, width=self.width, textvariable=self.var)
          self.entry.pack(side='left',fill='both')
  
          self.button = tk.Button(self, text='▼',command=lambda: self.changed('','','arrow'))
  
          self.button.pack(side='right')
  
          # Listbox length
          if 'listboxLength' in kwargs:
              self.listboxLength = kwargs['listboxLength']
              del kwargs['listboxLength']
          else:
              self.listboxLength = 8
  
          # Custom matches function
          if 'matchesFunction' in kwargs:
              self.matchesFunction = kwargs['matchesFunction']
              del kwargs['matchesFunction']
          else:
              def matches(fieldValue, acListEntry):
                  pattern = re.compile(re.escape(fieldValue) + '.*', re.IGNORECASE)
                  return re.match(pattern, acListEntry)
  
              self.matchesFunction = matches
  
          self.focus()
  
          self.autocompleteList = sorted(autocompleteList)
  
          self.listboxUp = False        
  
          self.entry.bind("&lt;Right&gt;", self.selection)
          self.entry.bind("&lt;Return&gt;", self.selection)
          self.entry.bind("&lt;Up&gt;", self.moveUp)
          self.entry.bind("&lt;Down&gt;", lambda e: self.moveDown(e))
          self.entry.bind("&lt;Escape&gt;", self.destroy)
  </code></pre>
  
  <p>Any help would be much appreciated.</p>