Tkinter: Frames in nested classes?

Fredrik Lundh fredrik at pythonware.com
Fri Jul 13 22:51:46 CEST 2001


Joshua Weage wrote:
> Following up to my own message, here is the solution
> (as done in Tkinter.py):

that's not a solution, that's code bloat.

> class Frame1(Frame):
>         def __init__(self, master=None, cnf={}, **kw):
>                 cnf = _cnfmerge((cnf,kw))
>                 Frame.__init__(self, master, cnf)

no need to use flatten or cnfmerge; just learn how to call
the base class constructor in Python, and all will be fine.

by the way, the cnf stuff is obsolete, and should not be
used in new code.  modern Tkinter code should look like:

        def __init__(self, master=None, **kw):
            Frame.__init__(self, master, **kw)

see my introduction document for more info.

</F>





More information about the Python-list mailing list