美文网首页
Python3 Tkinter-PaneWindow

Python3 Tkinter-PaneWindow

作者: zmqqq | 来源:发表于2019-03-25 16:05 被阅读0次

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

      本文链接:https://www.haomeiwen.com/subject/ifkbvqtx.html