title: Transient input window
body: <p>I have a system, where there is a popup window that requests input from the user, and then returns that input to the main body of code for processing. I have the window popping up correctly, using transient to ensure it stays ontop, however I cannot find a way to make the window return data to the place it was called from.
  Current:</p>
  
  <pre><code>from tkinter import *
  
  class loginwindow(object):
      def __init__(self, parent):
          self.parent=parent
          self.data=None #Default value, to say its not been set yet
          self.root=Toplevel(self.parent)
          self.root.transient(self.parent)
          self.username=Entry(self.root)
          self.password=Entry(self.root, show="*")
          self.ok=Button(self.root, text="Continue", command=self.checkPass); self.ok.grid(row=5, column=2, sticky="ew")
          self.cancel=Button(self.root, text="Cancel", command=self.cancelPass); self.cancel.grid(row=5, column=1, sticky="ew")
  
  
      def checkPass(self):
          self.data=(self.username.get(), self.password.get())
          self.root.quit()
  
      def cancelPass(self):
          self.data=False
          self.root.quit()
  
  parent=Tk()
  passWindow=loginwindow(parent)
  #....? how do I get passWindow.data from the window, considering it will only be defined 
  #to be something besides None once the user has clicked the continue button
  </code></pre>
  
  <p>I have tried loops to wait for the value of <code>passWindow.data</code> to change from <code>None</code>, however that leads to <code>loginwindow</code> not appearing, or the script locking up. Ideally I want to keep <code>transient</code> there as it prevents the user clicking off the window, but I know that <code>transient</code> is the cause of the window not appearing (works fine without)</p>
  
  <p>Any ideas?</p>