Can you change a Tkinter widget's master?

Theodore D. Sternberg strnbrg at c532352-a.frmt1.sfba.home.com
Sat May 12 11:37:22 EDT 2001


In Tkinter, is there any way to change a widget's master?  Assigning to
the master attribute doesn't seem to have any effect.

Setting (or resetting) the master would be the key to true compound widgets.
For example, you could subclass Frame to take as constructor arguments several
widgets (of any kind) and arrange them in some given way.  

You could of course pass the construction language as a string and then
call eval on it.  But this strategy would be way too cumbersome if you
wanted to have several levels of nested widgets.

Maybe this is too much to ask of Tkinter, since in Tk the identity of
the master is fixed as part of the slave's name.

Ted Sternberg
Fremont California



More information about the Python-list mailing list