A Tkinter StringVar() Question

Posted by Graham on Stack Overflow See other posts from Stack Overflow or by Graham
Published on 2010-05-05T03:24:31Z Indexed on 2010/05/05 3:28 UTC
Read the original article Hit count: 225

Filed under:
|
|
|
|

I would like to create a StringVar() that looks something like this:

someText = "The Spanish Inquisition" #Here's a normal variable whose value I will change

eventually

TkEquivalent = StringVar() #and here's the StringVar()

TkEquivalent.set(string(someText)) #and here I set it equal to the normal variable. When

someText changes, this variable will too...

HOWEVER:

TkEquivalent.set("Nobody Expects " + string(someText))

If I do this, the StringVar() will no longer automatically update! How can I include that static text and still have the StringVar() update to reflect changes made to someText?

Thanks for your help.

© Stack Overflow or respective owner

Related posts about python

Related posts about tkinter