I'm a newbie at Python and trying my first layout with grid. What I really need is this layout:
My listing is:
1. root=Tk()
2. root.geometry("640x480")
3. root.title("Skroutz Parser")
#entryText=StringVar(root)
4. topFrame=Frame(root, bg='cyan', width = 640, height=80)
5. middleFrame=Frame(root,bg='gray2', width=640, height=400)
6. bottomFrame=Frame(root, bg='yellow', width = 640, height=50)
# layout all of the main containers
7. root.grid_rowconfigure(1, weight=1)
8. root.grid_columnconfigure(0, weight=1)
9. topFrame.grid(row=0)
10.middleFrame.grid(row=1)
11.bottomFrame.grid(row=2)
# layout middle container
12.middleFrame.grid_rowconfigure(0, weight=1)
13.middleFrame.grid_columnconfigure(0, weight=1)
14.leftFrame=Frame(middleFrame, bg='green', width = 125, height=400)
15.rightFrame=Frame(middleFrame, bg='white', width = 515, height=400)
16.leftFrame.grid(row=0,column=0,sticky="n")
17.rightFrame.grid(row=0, column=1)
18.buttonFeatured=Button(leftFrame, text=' Recommended ', pady=5, .command=showRecommendedProductsResults)
19.buttonSkroutz=Button(leftFrame, text='Skroutz Products', pady=5, command=printSkroutzProducts)
20.buttonFeatured.grid(row=0, column=0, sticky="n")
21.buttonSkroutz.grid(row=1, column=0)
22.entryText=StringVar()
23.entryMain=Entry(rightFrame,textvariable=entryText, bg="white")
24.entryMain.grid(row=0,column=0,rowspan=2,columnspan=5,sticky="w")
25.root.mainloop()
If i comment lines 18-24, then I get more or less the desired layout:
if I uncomment lines 18-21 (leaving commented lines 22-24) then I get this (strange black color on left frame):
and if I uncomment the rest of the lines....I get a mess!!!
I'm struggling two days now, but no luck.... Any help will be appreciated! Thanks!