Basically, I want the body of a Text widget to change when a StringVar does.
Basically, I want the body of a Text widget to change when a StringVar does.
Short version is, you can't. At least, not without doing extra work. The text widget doesn't directly support a variable
option.
If you want to do all the work yourself it's possible to set up a trace on a variable so that it keeps the text widget up to date, and you can add bindings to the text widget to keep the variable up to date, but there's nothing built directly into Tkinter to do that automatically.
The main reason this isn't directly supported is that the text widget can have more than just ascii text -- it can have different fonts and colors, embedded widgets and images, and tags.