0
항목을 지우고 clear (clearTextBox())하고 newQuote()를 실행하려고합니다. 두 번째 바인딩을 추가 했으므로 삭제되지 않습니다. 어떤 아이디어?엔트리 위젯이 함수에서 지워지지 않을 것입니다.
from random import *
from tkinter import *
def clearTextBox(event):
textBox.delete(0, END)
textBox.insert(0, "")
def newQuote(event):
rightLabel.config(text=quotes[randint(0,10)])
textBox = Entry(leftFrame, width=60)
textBox.pack(ipady=10, side=LEFT)
textBox.bind("<Return>", clearTextBox)
textBox.bind("<Return>", newQuote)
root.mainloop()
덕분에 빠른 도움이 완벽하게 작동! 8 분 안에 진드기를 맞히고, 너무 빠르다. –
콜백 함수를 하나만 사용하여 여러 함수를 호출하는 경우에도 [이 대답] (https://stackoverflow.com/a/5839549/7032856)을 볼 수 있습니다. . – Nae