Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Push My Buttons

Sahar Nasiri
Sahar Nasiri
7,454 Points

columnconfigure and rowconfigure

I don't understand why we use this and I also did not understand why Kenneth didn't set the rowconfigure for buttons! He said because we have one row which is not going to resize, when did we build that rowconfigure? And if it is a default thing why did he set rowconfigure(0, weight=0) for the first grid?

1 Answer

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

Oh, jeez, way to ask a question about a year-plus-old workshop on a topic I don't actively pursue :)

Looking back over my script and the code, since we're putting the buttons into their own frame, which has a grid made up of a single row and two columns, we had to tell tkinter which column each button belonged in. Since there's only one row, that's set automatically.

As for the first row in the outer frame, that grid has multiple rows (and a single column) so we specify that so we can give each row in the column a specific weight, which controls how it resizes.

It's two special cases so we have to address each of them.