Tkinter window minsize question

Matthew Dixon Cowles matt at mondoinfo.com
Sun Oct 7 15:55:48 EDT 2001


On Sun, 7 Oct 2001 16:06:16 +0400 (MSD), Roman Suzi <rnd at onego.ru>
wrote:

>I am wondering why when I execute the following piece of code after
>BUTTON1 is pressed top level window become less than specified
>minsize:

[. . .]

>While when I resize it manually (to the greater size) it remains in
>tact. What is wrong?

It's because the window manager you're using isn't enforcing the
minimum size request until you resize the window manually. Depending
on your point of view, that may or may not be reasonable. On the one
hand, the program requests a particular minimum size and on the other
hand (through Tkinter's pack manager) reqests a smaller size.

You can fix your particular problem by specifying width and height
options when you create the frames and sending them each a
pack_propagate(0). In general, there are enough window managers in use
and they behave differently enough that it's best to program as though
window manager commands might or might not be followed.

Regards,
Matt



More information about the Python-list mailing list