I have problems using label.config(textvariable=texto)
.
As a result, it seems that text StringVar()
has no content because 'TextoVariable' does not appear in the window.
It seems to be an error of Tkinter
in High Sierra
and not in Windows
.
Is there another syntax to show variables as StringVar
?
import tkinter as tk
root = tk.Tk()
texto = tk.StringVar(value='Texto inicial')
texto.set(value='TextoVariable')
label = tk.Label(root)
label.pack(anchor='center')
tk.Label(root, text='Hola Saturno').pack(anchor='se')
label.config(bg='green', fg='blue', font=('Verdana',24))
label.config(textvariable=texto)
root.mainloop()