tkinter: making widgets instance or not?

John Salerno johnjsal at
Tue Jun 6 21:56:38 CEST 2006

John Salerno wrote:

> 2. Related to your comment, the obvious problem here is that it doesn't 
> save references to the text box names, so I can't access them later. Is 
> there still a way to automate the process like I've done, but have each 
> entry field have a separate name?

A thought about this: maybe I can pass in the name of what I'd like the 
entry field to be called as another parameter, then after the entry 
object is created I can say something like:

self.<myname> = self.entry

Of course, I'm not sure how to write the left side, because I assume I'd 
have to pass in my new name as a string, but a string wouldn't work as 
an instance variable.

Also, would there be any problems with this kind of assignment? Any 
weird reference problems that makes this not really work?

More information about the Python-list mailing list