main window in tkinter app

William Gill noreply at gcgroup.net
Tue Jul 19 09:42:59 EDT 2005


 > I never ran into this problem. ...

O.K. That, means I probably have something else wrong.  I will need to 
start with a 'clean slate' instead of trying to modify existing code. 
It's getting to convoluted to follow anyway after all the cobbling I've 
done.

If I get a repeat of the original problem I will post the code and the 
exact error message, but at least now I know It SHOULD work.

Thanks

Bill,


Eric Brunel wrote:
> 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...



More information about the Python-list mailing list