Label 放置到(0,0)位置上
lb.place(x=0,y=0,anchor='nw')
root.mainloop()
结果:
?...in 不是可以随意指定放置的组件的,如果使用 in 这个参数这个组件必需满足:是其父容器或父容器的子组件
事件与 Place 结合使用
最后使用两个 place 方法来动态改变两个 Frame 的大小...red',width=40,height=40)
fm2 = tk.Frame(root,bg='blue',width=40,height=40)
# 单击 fm1时增大它的占有区域0.1
def ...place(rely=0,relheight=split,relwidth=1)
fm2.place(rely=split, relheight=1-split, relwidth=1)
# 单击...place(rely=0, relheight=split, relwidth=1)
fm2.place(rely=split, relheight=1-split, relwidth=1)
# 绑定单击事件