How to clear the Entry widget after a button is pressed in Tkinter?

后端 未结 11 1094
渐次进展
渐次进展 2020-12-01 10:44

I\'m trying to clear the Entry widget after the user presses a button using Tkinter.

I tried using ent.delete(0, END), but I got an error

11条回答
  •  一生所求
    2020-12-01 11:14

    First of all, make sure the Text is enabled, then delete your tags, and then the content.

    myText.config(state=NORMAL)
    myText.tag_delete ("myTags")
    myText.delete(1.0, END)
    

    When the Text is "DISABLE", the delete does not work because the Text field is in read-only mode.

提交回复
热议问题