I am wondering if there is a way to make a grids
rows
and columns
fit the size of the Frame
that is set. So that if I create a Frame
and set its size that the grid
will fit the size of the Frame
.
This is what I tried so far:
window = Tk()
frame = Frame(window)
frame.place(x=0, y=0, width=200, height=200)
title = Label(frame, text="The Title", bg="cornflower blue", height=2)
title.grid(row=0, column=0, sticky=NSEW)
sort_button = Button(frame, text="The Button", relief="groove", height=2, bg="maroon1",)
sort_button.grid(row=1, column=0, sticky=NSEW)
window.mainloop()
For example this is the output of my current code:
But this is what I want: