tkinter frames
Martin Rand
hsl at tcp.co.uk
Thu Jul 6 13:04:14 EDT 2000
On Thu, 06 Jul 2000 14:49:56 GMT, Keith Murphy <kpmurphy at my-deja.com>
wrote:
>can anyone tell me why this doesn't work?
>
>from Tkinter import *
>
>root = Tk()
>myFrame = Frame(root, width=200, height=200, bg='red')
>myFrame2 = Frame(root, width=200, height=200, bg='orange')
>
>label1 = Label(myFrame, text='hi')
>
>myFrame.grid(row=0, column=0)
>myFrame2.grid(row=0, column=2)
>
>root.mainloop()
>
>
>...(in my mind)it should display two colored frames, one containing a
>label.
>
You need to apply the appropriate geometry manager to label1 to get it
displayed within the frame.
--
Martin (off-duty)
Chandlers Ford, Hampshire
More information about the Python-list
mailing list