[Tutor] A simple problem with Tkinter

Kent Johnson kent_johnson at skillsoft.com
Thu Sep 30 16:37:03 CEST 2004


You have to call pack() on the components to get them to appear:

from Tkinter import *
root=Tk()
w=Label(root,text="Hello!!")
w.pack()
b=Button(root,text="Bye",command='exit')
b.pack()
root.mainloop()

Kent

At 04:08 PM 9/30/2004 +0200, Mark Kels wrote:
>hello,
>
>I wrote this basic Tkinter code:
>
>from Tkinter import *
>root=Tk()
>w=Label(root,text="Hello!!")
>b=Button(root,text="Bye",command='exit')
>root.mainloop()
>
>But the output is an empty TK window (without the text and the button)...
>What is the problem ?
>_______________________________________________
>Tutor maillist  -  Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list