After already assigning a textvariable to a widget, how do I remove it? widget.config(textvariable=None) just isn't working. Couldn't find anything on google or here.
After already assigning a textvariable to a widget, how do I remove it? widget.config(textvariable=None) just isn't working. Couldn't find anything on google or here.
Assign your variable to an empty string to achive this.
import tkinter as tk
root = tk.Tk()
var = tk.StringVar()
label = tk.Label(root, textvariable=var)
label.pack()
print(f"var= {label['textvariable']}")
label.config(textvariable='')
print(f"var= {label['textvariable']}")
root.mainloop()