[英]Why does calling root.destroy still not continue my loop?
我正在創建一個棋盤游戲,並且我正在使用Tkinter作為GUI界面。 我創建了這樣的主循環:
while gameOn == True: #The loop
main_game_AI() #This is the actual game
root.mainloop() #This puts together the window.
root.destroy() #This closes the mainloop so the loop can continue.
但是當我運行它時,循環只重復了一次。 函數的順序有問題嗎?
在根窗口被破壞或調用root.quit()
之前, root.mainloop()
不會返回。 因此,在用戶退出程序之前,不會調用yoru對root.destroy()
調用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.