以下代码正常工作。它显示一个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