[英]python's tkinter button color change is not getting updated
我正在編寫一個小程序,其中單擊按鈕時,標簽的顏色變為綠色(默認情況下為紅色),並在一段時間后恢復為紅色。 使用time.sleep()不起作用。
The code that I have already tried is:
def change():
label1.configure( bg ='green')
#problem comes here ...
label1.configure ( bg ='red')
# label1 is defined here..........
change() #doesn't work......
以上如何運作?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.