title: About tkinter StringVar()
body: <p>i am having issue with the tkinter StrinVar() and i dont have much knowledge in tkinter and would like some help, thanks.</p>
  
  <p>What i have done is i created two window in which each has a Entry widget and Button widget if you click button of one window then that window gets withdraw and another window pop ups and if you click button in that pop up window then it withdraws and a original window gets pop up.Here is the code:-</p>
  
  <pre><code>from tkinter import *
  def x():
      a1.set("")
      a.withdraw()
      b.deiconify()
  def y():
      b1.set("")
      b.withdraw()
      a.deiconify()
  a=Tk()
  a.withdraw()
  a1=StringVar()
  b1=StringVar()
  Entry(a,textvariable=a1).pack()
  Button(a,text="button1",command=x).pack()
  a.withdraw()
  b=Tk()
  Entry(b,textvariable=b1).pack()
  Button(b,text="button2",command=y).pack()
  mainloop()
  </code></pre>
  
  <p>if you write something in entry widget and press button2 then second window pop ups then again if you write something in entry widget and press button1 the entry field is not getting updated in previous first window.</p>
  
  <p>i found that someone suggested that there should not be two instanses of <code>Tk()</code> a tkinter must have only one instanse of <code>Tk()</code> for multiple window use <code>Toplevel()</code>. So, i changed <code>b=Tk()</code> to <code>b=Toplevel()</code> which works fine and <code>StringVar()</code> was updating value</p>
  
  <p>Now, my question is that 1)What is the reason/logic behind not updating <code>StingVar()</code> with two instanses of <code>Tk()</code>2) is there any way to make <code>StringVar()</code> to update value with having two instanses of <code>Tk()</code></p>