以下代碼正常工作。它顯示一個panedwindow
,與頂部的藍色方塊和下方的綠框:爲什麼窗口小部件的創建順序很重要?
panedwindow .root -orient vertical -showhandle true -background red
frame .top -background blue -width 100 -height 100
frame .bot -background green -width 100 -height 100
.root add .top .bot
pack .root -expand true -fill both
然而,當我移動panedwindow
命令下來,事情停止工作。頂部藍色框未顯示。相反,panedwindow
本身的紅色彪炳:
frame .top -background blue -width 100 -height 100
panedwindow .root -orient vertical -showhandle true -background red
frame .bot -background green -width 100 -height 100
.root add .top .bot
pack .root -expand true -fill both
爲什麼會出現這種情況? panedwindow
真的只能管理在它之後創建的小部件嗎?我已經看到與打包器類似的行爲,它會拒絕打包稍後發佈的小部件-in
小部件。
現在看來很明顯,我看着它。謝謝您的幫助! – 2009-08-11 13:30:41