I want to divide space equally between three buttons using Grid Layout in Tkinter. And those buttons should occupy the space equally even when the window is resized horizontally.
################################
#| btn1 || btn2 || btn3 |#
################################
Here's my code:
import tkinter as tk
from tkinter import ttk
win = tk.Tk()
win.grid_columnconfigure(0, weight=1)
btn1 = ttk.Button(win, text='btn1')
btn1.grid(column=0, row=0, columnspan=1, sticky='EW')
btn2 = ttk.Button(win, text='btn2')
btn2.grid(column=1, row=0, columnspan=1, sticky='EW')
btn3 = ttk.Button(win, text='btn3')
btn3.grid(column=2, row=0, columnspan=1, sticky='EW')
win.mainloop()