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

A note on window responsiveness

We used .grid_propagate(False) in this program to ensure that our frames did not shrink to fit their contents, but rather stayed at a fixed height and width that we had specified while making the frames.

This served us well for this example, but this made our window and its content fixed in size. This is what you would typically call a non-responsive window.

Let us take a look at the program nonresponsive.py as an example of a non-responsive window. This program simply draws 10 buttons in a row:

from tkinter import Tk, Buttonroot = Tk()for x in range(10): btn = Button(root, text=x ) btn.grid(column=x, row=1, sticky='nsew')root.mainloop()

Run this program and resize the window. These buttons are drawn on the ...

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