title: How to bind Alt-F4 with Python tkinter?
body: <p>I am building a GUI application using Python and Tkinter.
  I want to control the behavior of the program when the user closes it.</p>
  
  <p>I've installed a new <code>WM_DELETE_WINDOW</code> protocol using:</p>
  
  <pre><code>root = Tk()
  root.protocol("WM_DELETE_WINDOW", lambda: closes_gracefully())
  </code></pre>
  
  <p>This indeed is working when the user clicks the <code>X</code> button on the titlebar, but it is NOT working when the user presses <kbd>ALT</kbd>+<kbd>F4</kbd>.</p>
  
  <p>I tried binding the key sequence: <code>root.bind("&lt;Alt-F4&gt;", lambda: closes_gracefully())</code> but it did not work.</p>
  
  <p>How can I capture the <kbd>ALT</kbd>+<kbd>F4</kbd> event?</p>