Tkinter window minsize question

Roman Suzi rnd at onego.ru
Sun Oct 7 08:06:16 EDT 2001


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

------------------------------------------------------------
#!/usr/bin/env python

from Tkinter import *
root = Tk()
root.minsize(600, 400)

def to_f2():
  f1.pack_forget()
  f2.pack(fill=BOTH, expand=1)

# prepare frame 1
f1 = Frame(root)
b1 = Button(f1, text="BUTTON1", command=to_f2)
b1.pack(fill=BOTH)

# pack frame 1
f1.pack(fill=BOTH, expand=1)

# prepare frame 2
f2 = Frame(root)
b2 = Button(f2, text="BUTTON2", command=root.destroy)
b2.pack(fill=BOTH)
l2 = Label(f2, text="Label")
l2.pack(fill=BOTH)

root.mainloop()
----------------------------------------------------------

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

Sincerely yours, Roman Suzi
-- 
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at onego.ru _/
_/ Sunday, October 07, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "How come there's only one Monopolies Commission?" _/





More information about the Python-list mailing list