title: Checkbuttons with Multiple Tkinter Windows
body: <p>Specs:<br>
  Python2.7.1<br>
  Tkinter (Tk version 8.5)<br>
  Windows7<br>
  IDLE 2.7.1</p>
  
  <p>I'm coding a program that 'spawns' two windows, withdraws both, destroys one and then deiconifies the other (which then enters a mainloop).<br>
  This arrangement is interfering with a Checkbutton on the remaining window.</p>
  
  <p>eg:</p>
  
  <pre><code>temp = Tk()
  temp.withdraw()
  
  root = Tk()
  root.withdraw()
  temp.destroy()
  
  root.mainloop()
  </code></pre>
  
  <p>(It seems unusual, but it is set up this way so that the 'temp' window will display the problems that arose, during building of the root window).</p>
  
  <p>However,
  it seems that as soon as a single program deals with two Tkinter windows,
  functionality of a Checkbutton (in root) goes out the window.</p>
  
  <pre><code>def ClickAButton():
      print Toggle.get()
  Toggle = IntVar()
  Checkbutton(root, text = "Me is broke", variable = Toggle).pack()
  ClickAButton
  </code></pre>
  
  <p>Toggle.get() should return a 1 if the Checkbutton is ticked, otherwise a 0.<br>
  However, since adding the new window, Toggle.get always returns a 0.</p>
  
  <p>(I've tried reformatting code {this brings up strange erros of it's own},<br>
  renaming variables, etc.<br>
  The Checkbutton works just fine without the 'temp' window.</p>
  
  <p>The 'temp' window is destroyed before the Checkbutton is even assigned, packed,<br>
  or 'root' even enters a mainloop!)</p>
  
  <p>Entire eg:</p>
  
  <pre><code>temp = Tk()
  temp.withdraw()
  root = Tk()
  root.withdraw()
  if 'certain condition':
      root.destroy()
      temp.deiconify()
      temp.mainloop()
  else:
      temp.destroy() 
      Toggle = IntVar()
      Checkbutton(root, text = "Why I only return 0?", variable = Toggle).pack()
      root.deiconify()
      root.mainloop()
  </code></pre>
  
  <p>For some reason,<br>
  the Checkbutton is always returns 0, even when checked.<br>
  I suspect it's a multi-threading issue with Tkinter.</p>
  
  <p>Is there anything at all I can do here?<br>
  (The actual coding is HUGE. I'm not eager to switch it all to another GUI module)
  :|</p>
  
  <p>Greatly appreciated!</p>
  
  <p>(I only started programming the start of this year.<br>
  Please forgive me if I've made some horribly noobish mistake!)</p>