Skip to content Skip to sidebar Skip to footer

The Height And Width Can't Be Adjusted When I Change The Size

from tkinter import * win = Tk() win.title('McDonald ordering system') win.geometry('600x300') lbtitle = Label(win,text='Welcome to McDonald',bg='yellow') lbtitle.grid(row=0,co

Solution 1:

As you wrote in your question you imported Frame through from tkinter import *. So you don't need to import it again.

To make the window visible add win.mainloop() at the end of your script.

Update:

This is how your program looks like on my system when executing it from the terminal (and having win.mainloop() at the end of the script).

enter image description here

Update 2:

I've changed this section by removing columnspan from the label and disabling resizing of the frame with grid_propagate:

lbtitle = Label(win,text='Welcome to McDonald',bg='yellow')
lbtitle.grid(row=0,column=1)

f1 = Frame(win,bd=2,width=200,height=250,relief=GROOVE)
f1.grid(row=1,column=0,rowspan=3)
f1.grid_propagate(0)

f2 = Frame(win,bd=2,width=200,height=250,relief=GROOVE)
f2.grid(row=1,column=1,rowspan=3)
f2.grid_propagate(0)

f3 = Frame(win,bd=2,width=200,height=250,relief=GROOVE)
f3.grid(row=1,column=2,rowspan=3)
f3.grid_propagate(0)

The results looks like this:

enter image description here

Post a Comment for "The Height And Width Can't Be Adjusted When I Change The Size"