title: return value from func that run tkinter python GUI by user press
body: <p>I want to build a tkinter python gui with 2 buttons: send and cancel. I want to run this gui from function that called run. if the user clicked on send the function will close the window and return True and if it clicked cancel the function will close the window and return False.</p>
  <pre><code>def send(window):
      global re
      window.destroy()
      re = True
  
  def cancel(window):
      global re
      window.destroy()
      re = False
  
  def run():
      re = True
      window = tk.Tk()
      b1 = tk.Button(window, text=&quot;send&quot;, command=lambda: send(window))
      b1.pack()
  
      b2 = tk.Button(window, text=&quot;cancel&quot;, command=lambda: cancel(window))
      b2.pack()
  
      window.mainloop()
      return re
  </code></pre>
  <p>i tried to do it but it always return True is there a way to do it without oop?</p>