main window in tkinter app

Eric Brunel eric_brunel at despammed.com
Tue Jul 19 02:50:39 EDT 2005


On Mon, 18 Jul 2005 16:57:51 GMT, William Gill <noreply at gcgroup.net> wrote:

> A short while ago someone posted that(unlike the examples) you should
> use Tk as the base for your main window in tkinter apps, not Frame.   Thus :
>
>    class MyMain(Frame):
>            def __init__(self, master):
>                self.root = master
>                self.master=master
>                self.createWidgets()
>            def createWidgets():
>                 ...
>        root = Tk()
>        app = MyMain(root)
>        app.master.title("Object Editor")
>        root.mainloop()
>
> would become:
>
>     class MyMain(Tk):
>        ...
>        ...
>     app = MyMain()
>     app.title("My App")
>     app.mainloop()
>
> When I try converting to this approach I run into a problem with the
> __init__() method.  It appears to go into an infinite loop in
> tkinter.__getattr__().
[...]

I never ran into this problem. Can you please post a short script showing this behavior? Without knowing what you exactly do in your __init__ and createWidgets method, it's quite hard to figure out what happens...
-- 
python -c "print ''.join([chr(154 - ord(c)) for c in 'U(17zX(%,5.zmz5(17;8(%,5.Z65\'*9--56l7+-'])"



More information about the Python-list mailing list