array of Tkinter variables?



I want to build an array of entry widgets in python with Tkinter that
all have similar textvariables. I was hoping that I could use an array
of StringVar variables to attach to these widgets, so that I can loop
through the widget creation. But my simple minded approach failed:

for i in range(32):
self.dllAdjust[i] = StringVar()
self.dllAdjust[i].set('000')

gives me the following error:

File "./config.py", line 787, in setDefaultVals
self.dllAdjust[i] = StringVar()
AttributeError: Configurator instance has no attribute 'dllAdjust'


("Configurator" is the class in which this code fragment appears)

How does one define an array of StringVar? If that is not possible, what
would be an alternative approach to the idea in the code fragment above?

Jo
--
Dr Joachim Schambach
The University of Texas at Austin
Department of Physics
1 University Station C1600
Austin, Texas 78712-0264, USA
Phone: (512) 471-1303; FAX: (814) 295-5111
e-mail: jschamba@xxxxxxxxxxxxxxxxxx
.



Relevant Pages

  • saving state via
    ... I am trying to find a 'best practice' method for saving / loading ... saving my application state as an array: ... "bad window path name" no matter what I pass in to it. ... Subject: tcl/tk:saving state of widgets?? ...
    (comp.lang.tcl)
  • Problem when switching from SoapClient to WebServicesClientProtocol
    ... I have a working C# class library that acts as a soap client. ... over the formatting of the soap body: ... It all boils down to the "this.invoke" method requiring an object array ... //populate the test widgets array ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: a question about tkinter StringVars()
    ... Within createWidgets() I create several StringVarsand assign them to the textvariable option of several widgets. ... Though 'var' would normally go out of scope when createWidgets ... only the name 'var' goes out of scope, not the StringVar object, Right? ... no reference from the Entry widget to the variable object. ...
    (comp.lang.python)
  • Re: ttk::checkbutton - I think, its a bug
    ... value for those widgets that implement the getter. ... linked to an array entry (with a dedicated array for ... for a long time whereby it basically did not work ...
    (comp.lang.tcl)
  • Re: Class in a Class
    ... Because a strongly typed collection of Nodes is NOT a LinkedList! ... an array of Widgets ... allowing you to create strongly typed linked lists! ...
    (microsoft.public.dotnet.languages.vb)