टिंकर टेक्स्ट विजेट एक इनपुट विजेट है जो मल्टीलाइन उपयोगकर्ता इनपुट का समर्थन करता है। इसे टेक्स्ट एडिटर के रूप में भी जाना जाता है जो उपयोगकर्ताओं को इसमें सामग्री और डेटा लिखने की अनुमति देता है। टेक्स्ट विजेट की सामग्री को हटाएं(0, END) . को परिभाषित करके साफ किया जा सकता है आज्ञा। इसी तरह, हम एंट्री विजेट पर ही क्लिक करके कंटेंट को क्लियर कर सकते हैं। इसे एक क्लिक इवेंट के साथ फंक्शन को बाइंड करके हासिल किया जा सकता है।
उदाहरण
#Import the required libraries
from tkinter import *
#Create an instance of Tkinter Frame
win = Tk()
#Set the geometry of Tkinter Frame
win.geometry("700x250")
#Define a function to clear the content of the text widget
def click(event):
name.configure(state=NORMAL)
name.delete(0, END)
name.unbind('<Button-1>', clicked)
#Create a Label widget
label = Label(win, text= "Enter Your Name", font= ('Helvetica 13 bold'))
label.pack(pady= 10)
#Create an Entry widget
name = Entry(win, width=45)
name.insert(0, 'Enter Your Name Here...')
name.pack(pady=10)
#Bind the Entry widget with Mouse Button to clear the content
clicked = name.bind('<Button-1>', click)
win.mainloop() आउटपुट
उपरोक्त कोड को चलाने पर एक एंट्री विजेट के साथ एक विंडो प्रदर्शित होगी।

जब हम एंट्री फील्ड पर क्लिक करते हैं, तो यह इसकी सामग्री को अपने आप साफ कर देगा।
