title: Lock a main Tkinter window in Python and keep the X button running
body: <p>Sorry if I was not specific with the question, but it is a bit long and it is my first time consulting programming issues. I was creating a <em>Toplevel</em> in <em>Python</em> with the <em>Tkinter</em> module and I wanted to block the events in the main window while it is open. Googled and I found the method "<em>grab_set</em>", which takes me to the other end. That is, it blocks the events in the top bar of the window (close, maximize and minimize). Is there something similar to <em>grab_set</em> but without this happening?</p>
  
  <p>As an alternative, I can block all the entrys and buttons, but I don't know any way to unlink or re-link the binds. Is there any way?</p>
  
  <pre><code>original = Tk()
  entrada = Entry(original)
  entrada.pack()
  
  def otra_ventana(Self):
      ventana = Toplevel(original)
      ventana.grab_set()
  
  original.bind("&lt;F1&gt;", otra_ventana)
  </code></pre>
  
  <p>The above is a test code that has the problem that I mentioned.</p>
  
  <p><em>Postscript:</em> The problem only occurs when the Toplevel is open and an attempt is made to close the main window.</p>
  
  <p>Thank you.</p>