Python3 Tkinter-PaneWindow

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

你可能感兴趣的:(Python3 Tkinter-PaneWindow)