Python3 Tkinter-PaneWindow

2019-03-25  本文已影响0人  zmqqq

1.向PanedWindow中添加Pane

from tkinter import *

root=Tk()

panes=PanedWindow(orient=VERTICAL)
panes.pack(fill=BOTH,expand=1)
for w in [Label,Button,Checkbutton,Radiobutton]:
    panes.add(w(panes,text='hello'))

root.mainloop()
图片.png

2.删除Pane

from tkinter import *

root=Tk()
ws=[]
panes=PanedWindow(orient=VERTICAL)
panes.pack(fill=BOTH,expand=1)
for w in [Label,Button,Checkbutton,Radiobutton]:
    ws.append(w(panes,text='hello'))

for w in ws:
    panes.add(w)

panes.forget(ws[1])

root.mainloop()
图片.png
上一篇 下一篇

猜你喜欢

热点阅读