textvariable help

swisscheese jimlewis at miclog.com
Sat Jan 28 09:49:40 EST 2006

I must be missing something basic.
Can anyone explain why 'A' does not show on the entry widget?

import Tkinter
root = Tkinter.Tk()
class Col:
    Rows = [0]
    def __init__(self):
        Frame = Tkinter.Frame(root);
        Frame.pack (side='left')
        self.Rows[0] = Tkinter.StringVar();
        Tkinter.Entry(Frame,textvariable=self.Rows[0]).pack ();
X = Col()
# X.Rows[0].set ('A') # 'A' displays in Entry this way
Y = Col()
X.Rows[0].set ('A') # Why not also this way?
Y.Rows[0].set ('B')

More information about the Python-list mailing list