title: Trouble with Tkinter event handler inside of a class
body: <p>My problem is that I have a class that creates a Tkinter topclass object and then puts a field into it and I want to add an event handler that runs a method (that is also in the class) every time a button is pressed but when the event is called it says </p>
  
  <blockquote>
    <p>AttributeError: Toplevel instance has no attribute 'updateSearch'</p>
  </blockquote>
  
  <pre><code>class EditStudentWindow():
  
  def __init__(self):
  
      searchResultList = ['student1', 'student2', 'student3'] # test list
  
      ##### window attributes
  
      # create window
      self = Tkinter.Toplevel()
  
      #window title
      self.title('Edit Students')
  
      ##### puts stuff into the window
  
      # text
      editStudentInfoLabel = Tkinter.Label(self,text='Select the student from the list below or search for one in the search box provided')
      editStudentInfoLabel.grid(row=0, column=0)
  
      # entry box
      searchRepositoryEntry = Tkinter.Entry(self)
      searchRepositoryEntry.grid(row=1, column=0)
  
      # list box
      searchResults = Tkinter.Listbox(self)
      searchResults.grid(row=2, column=0)
  
      ##### event handler 
  </code></pre>
  
  <blockquote>
    <p>right here </p>
  </blockquote>
  
  <pre><code>    searchRepositoryEntry.bind('&lt;Key&gt;',command = self.updateSearch)
      # search results
  
      for result in searchResultList:
          searchResults.insert(Tkinter.END, result)
  
  def updateSearch(self, event):
      print('foo')     
  </code></pre>