tk.Button(window, text=text, font=("Arial", 18), command=lambda t=text: button_click(t))\ .grid(row=r, column=c, sticky="nsew", padx=5, pady=5) ...