title: Help with <key> event in python Entry widget
body: <p>I'm writing some code in python and I'm having trouble when trying to retrieve content of an Entry widget.
  The thing is: I want to limit the characters that can be typed, so I'm trying to clear the Entry widget when I reach the specific number of characters (2 in this case), but it looks like I always miss the last typed character. I added the lost character in a print to show.</p>
  
  <p>Here's the sample code:</p>
  
  <pre><code>from Tkinter import *
  class sampleFrame:
      def __init__(self, master):
          self.__frame = Frame(master)
          self.__frame.pack()
      def get_frame(self):
          return self.__frame
  
  
  class sampleClass:
      def __init__(self, master):
          self.__aLabel = Label(master,text="aLabel", width=10)
          self.__aLabel.pack(side=LEFT)
          self.__aEntry = Entry (master, width=2)
          self.__aEntry.bind('&lt;Key&gt;', lambda event: self.callback(event, self.__aEntry))
          self.__aEntry.pack(side=LEFT)
  
      def callback(self, event, widgetName):
          self.__value = widgetName.get()+event.char
          print self.__value
          if len(self.__value)&gt;2:
              widgetName.delete(2,4)
  
  
  
  
  
  root = Tk()
  aSampleFrame = sampleFrame(root)
  aSampleClass = sampleClass(aSampleFrame.get_frame())
  root.mainloop()
  </code></pre>
  
  <p>Any help will be much appreciated!</p>
  
  <p>Thanks in advance</p>