pack_propagate(0):

用來設定Frame的大小不隨著內部物件而變化

from Tkinter import *
root = Tk()
LARGE_FONT= ("Verdana", 12)

f = Frame(root, height=20, width=20, bg ='red')
f.pack_propagate(0)
f.place(x=0, y=0)
b1=Button(f, text="click", font=LARGE_FONT)
b1.pack()

root.mainloop()


results matching ""

    No results matching ""