O'Reilly logo

Tkinter GUI Application Development Blueprints - Second Edition by Bhaskar Chaudhary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Experimenting with the code

The best way to experience this piece of code is to make the following tweaks one by one, run the program, and resize the window to see the effect of each option.

As a first tweak, change the weights to 0:

 Grid.rowconfigure(root, x, weight=0) Grid.columnconfigure(root, x, weight=0)

This will make the window non-responsive again.

Next, reassign the weights back to 1 and then comment out one of the two lines and see the difference. If you comment out the rowconfigure line the buttons will be responsive in the y direction, but non-responsive in the x direction and vice versa for columnconfigure.

Restore the program to its original state and then assign a different weight in each loop by changing the weight to x

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required