title: Select all text in a Text widget using Python 3 with tkinter
body: <p>I'm working on my first Python program and have little idea what I'm doing.  I want to re-bind  ctrl-a (control a) to select all text in a Text widget.  The current binding is ctrl-/ (control /).  The binding part jumps right to the function but the actual text selection doesn't work.  Instead, the cursor jumps to the first character on the first line (like it should) and nothing else happens.  I'm sure this is embaressingly easy to fix but after spending hour an hours on it, I can't figure out what's wrong.  </p>
  
  <p>Python 3, Windows:</p>
  
  <pre><code>from tkinter import *
  
  # Select all the text in textbox (not working)
  def select_all(event):
      textbox.tag_add(SEL, "1.0", END)
      textbox.mark_set(INSERT, "1.0")
      textbox.see(INSERT)
  
  # Open a window
  mainwin = Tk()
  
  # Create a text widget
  textbox = Text(mainwin, width=40, height=10)
  textbox.pack()
  
  # Add some text
  textbox.insert(INSERT, "Select some text then right click in this window")
  
  # Add the binding
  textbox.bind("&lt;Control-Key-a&gt;", select_all)
  
  # Start the program
  mainwin.mainloop()
  </code></pre>