-3
How can I build this layout using Grid? The gray rectangle used place, however, I would like to know how to get the same result using Grid in all elements.
from tkinter import *
class Main():
def __init__(self, master = None):
self.topFrame = Frame(master, width = 1200 , height = 30 , bg = "blue")
self.topFrame.grid(row = 0, column = 0)
self.middleFrame = Frame(master, width = 1200, height = 600 , bg = "cyan")
self.middleFrame.grid(row = 1, column = 0)
self.bottomFrame = Frame(master, width = 1200, height = 70, bg = "yellow")
self.bottomFrame.grid(row = 2, column = 0)
self.leftFrame = Frame(self.middleFrame, width = 150, height = 600, bg = "gray")
self.leftFrame.place(x = 0 , y = 0)
root = Tk()
w = 1200
h = 700
wScreen = root.winfo_screenwidth()
hScreen = root.winfo_screenheight()
x = (wScreen/2) - (w/2)
y = (hScreen/2) - (h/2)
root.geometry('%dx%d+%d+%d' % (w, h, x, y))
root.title("Sistema com Tkinter")
root.iconbitmap(r'icon/admin.ico')
Main(root)
root.mainloop()
Thank you. Solved!
– Max Mendes