我期望下面的代碼產生的文本區域佔用屏幕的一半,因爲列的權重相等。Tkinker網格權重不符合我的預期
爲什麼文本區佔用大約2/3的屏幕,而我怎樣才能讓文本區只佔用屏幕的一半?
from tkinter import *
root = Tk()
root.wm_state('zoomed')
root.columnconfigure(0, weight=1)
root.columnconfigure(1, weight=1)
root.rowconfigure(0, weight=1)
root.configure(bg='red')
info_frame = Frame(root)
info_frame.grid(row=0, column=1, sticky="nsew")
info_frame.columnconfigure(0, weight=1)
info_frame.rowconfigure(0, weight=1)
user_frame = Frame(root, bg='blue')
user_frame.grid(row=0, column=0, sticky="nsew")
user_frame.columnconfigure(0, weight=1)
user_frame.rowconfigure(0, weight=1)
user_frame.rowconfigure(1, weight=1)
button_frame = Frame(user_frame)
button_frame.grid(row=0, column=0, sticky="nsew")
entry_frame = Frame(user_frame)
entry_frame.grid(row=1, column=0, sticky="nsew")
info_display = Text(info_frame, state=DISABLED)
info_display.grid(row=0, column=0, sticky="nsew")
scrollbar = Scrollbar(info_frame)
scrollbar.grid(row=0, column=1, sticky="nsew")
light_label = Label(entry_frame, text='Light').grid(row=0, column=0)
light_entry = Entry(entry_frame).grid(row=0, column=1)
current_label = Label(entry_frame, text='Current').grid(row=1, column=0)
current_entry = Entry(entry_frame).grid(row=1, column=1)
button1 = Button(button_frame, text='button1').grid(row=0, column=0)
button2 = Button(button_frame, text='button2').grid(row=0, column=1)
button3 = Button(button_frame, text='button3').grid(row=1, column=0)
button4 = Button(button_frame, text='button4').grid(row=1, column=1)
root.mainloop()