fredrik at pythonware.com
Sat Jan 28 09:56: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 = 
> def __init__(self):
> Frame = Tkinter.Frame(root);
> Frame.pack (side='left')
> self.Rows = Tkinter.StringVar();
> Tkinter.Entry(Frame,textvariable=self.Rows).pack ();
> X = Col()
> # X.Rows.set ('A') # 'A' displays in Entry this way
> Y = Col()
> X.Rows.set ('A') # Why not also this way?
> Y.Rows.set ('B')
Rows is a class variable, and since you're modifying it in place, Rows will
always be set to the most recently created Entry widget.
what is it you're trying to do here ?
More information about the Python-list