from tkinter import * #從tkinter函式庫輸入所有函式,檔案'window001.py'
import time #412單元延續數入time套件
def delete(): #增加自訂函數def delete()
List[int(n.get())-1].destroy() #destroy破壞視窗List[索引]
win.config(bg='#1099ff')
b1=Label(win,text='劉任昌',font='Arial 100 bold',bg='#10ff10').pack()
x=('林','青','霞','💩','\U0001F609','\U0001F4ff') #建立元祖tuple名為x,0,1,2,3,4,5
List = [] #建立串列list名為List
win=Tk() #建構子constrctor Tk, Toplevel
win.geometry('400x200+800+0')
win.title('劉帥哥的視窗')
n = StringVar(win) #類別變數
n.set('刪除')
op1 = OptionMenu(win,n,1,2,3,4,5,6).pack(side=LEFT)
bu1 = Button(win,text='刪除選取視窗',command=delete,font='20',bg='blue',fg='white')
bu1.pack()
for i in range(6):
window = Toplevel()
window.title('劉帥哥第%d個視窗' % (i+1))
window.geometry('300x300+%d+%d' % (i*300,i*100))
window.config(bg='#f90')
b1=Label(window,text=x[i],font='Arial 200 bold').pack()
window.update()
time.sleep(0.3)
List.append(window) #新增指令:將視窗存在串列List
mainloop()
https://the-most-great-hsing-tsen.blogspot.com/2024/05/pythontkinter.html
回覆刪除https://yyyyyyjuuuuuuuu.blogspot.com/2024/05/pythontkinter.html
回覆刪除https://fanyahui.blogspot.com/2024/05/blog-post_15.html
回覆刪除https://meimei20041026.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除https://the-most-great-teather.blogspot.com/2024/05/blog-post_15.html
回覆刪除https://manranwen.blogspot.com/2024/05/pythontopleveltk-5-15-2024.html
回覆刪除https://euhffh822.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除https://yiminglinn.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除https://huilii.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除作者已經移除這則留言。
回覆刪除https://xi-xbox-mmi.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除https://hsiao-yu0711.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除https://www.blogger.com/blog/post/edit/2281312146505496012/8379620187416426993
回覆刪除https://kai2424.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除https://kevin124574811.blogspot.com/2024/05/blog-post.html
回覆刪除https://sushshshaq119.blogspot.com/2024/05/1.html
回覆刪除https://682amber.blogspot.com/2024/05/youtube-video-player.html
回覆刪除https://pcai766.blogspot.com/2024/05/pythontkinter.html
回覆刪除https://56788888.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除https://the-most-great-chenxi.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除https://earnest-person.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除https://michelle814.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除https://s10655075.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除https://ymo0831.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除https://shenzhenxuan.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除https://supocheng25.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除https://www.blogger.com/blog/post/edit/preview/2975575936248622997/2562093197182781249
回覆刪除https://honghikun.blogspot.com/2024/05/pythontopleveltk.html
回覆刪除作者已經移除這則留言。
回覆刪除