Aug 1, 2019 04:34 PM
(This post was last modified: Aug 1, 2019 04:38 PM by Avispon99.)
Because when I use textvariable from a secondary window that was called from a command in another window, the value set through .set () is not reflected in the secondary window Label.
Example:
In this case, the 'TEST' message set through v1.set () is not updated in the text variable of the Label that was created in the test() function
Why does this happen?
Example:
Code
import tkinter as tk
def test():
ven=tk.Tk()
v1=tk.StringVar()
v1.set('TEST')
print(v1.get())
tk.Label(ven, textvariable=v1).pack()
ven.mainloop()
win=tk.Tk()
tk.Button(text='BOTON',command=test).pack()
win.mainloop()In this case, the 'TEST' message set through v1.set () is not updated in the text variable of the Label that was created in the test() function
Why does this happen?

