Expand Text widget to fill the entire parent Frame in Tkinter

前端 未结 3 1470
执念已碎
执念已碎 2021-01-01 15:45

I got this Text widget, and I\'d like for it to expand and fill its entire parent, using the Grid geometry manager.

According to the examples I\'ve seen

3条回答
  •  温柔的废话
    2021-01-01 16:31

    from tkinter import *
    root = Tk()
    
    input_text_area = Text(root)
    input_text_area.grid(row=0, column=0, columnspan=4, sticky=N+S+W+E)
    input_text_area.configure(background='#4D4D4D')
    root.grid_columnconfigure(0, weight=1)
    root.grid_rowconfigure(0, weight=1)
    
    root.mainloop()
    

    not sure if this is what you want. but this fills the entire screen.

提交回复
热议问题