我有一个改变图像的代码。 我用过。但我想通过数据输入来调整时间(3000毫秒)。 我该怎么做
muted3 = False
def mute_music3():
global muted3
if muted3:
volumeKnop3.configure(image=volumePhoto3)
muted3 = False
root.after(3000, mute_music3)
else:
volumeKnop3.configure(image=mutePhoto3)
muted3 = True
root.after(0, mute_music3)
mutePhoto3 = PhotoImage(file="C:\\Users\\evanh\\Desktop\\buttonimage\\Time_Done.png")
volumePhoto3 = PhotoImage(file="C:\\Users\\evanh\\Desktop\\buttonimage\\Time_Not_Done.png")
volumeKnop3 = Button(image=volumePhoto3, command=mute_music3, background="white", activebackground="White", border=0)
volumeKnop3_window = canvas.create_window(30, 200, anchor="nw", window=volumeKnop3)
目前没有回答
相关问题 更多 >
编程相关推荐