PyRoss
PyRoss

Reputation: 129

(Python 3.4 Tkinter) Button grid filling issue

Trying to figure out how to get a Button in Tkinter to align on X axis (filling the entire axis) to make it stretch as I re-size the window. I know there is a .pack(fill=X) command, but I'm using .grid() and Python doesn't allow to mix them.

Upvotes: 0

Views: 375

Answers (1)

TidB
TidB

Reputation: 1759

You have the columnconfigure method for that:

b = tk.Button(root, text="bla")
b.grid(row=0, column=0, sticky="nwes")
root.columnconfigure(0, weight=1)

Upvotes: 2

Related Questions