I am trying to work with a text widget using tkinter.
Below is the code snippet
- Code: Select all
import tkinter as tk
"class including info and functions on gui window and system"
"initiating the instance of class"
"initiating the instance of ancestor class"
toolbar = tk.Frame(self)
b1 = tk.Button(self, text="Click Here")
exit_button = tk.Button(self,text="Exit",bg="orange",command = self.destroy)
t1 = tk.Text(self, wrap="word")
t1.pack(side="top", fill="both" , expand=True)
t1.insert('1.0', 'my status here.\n')
delete_button = tk.Button(self, text="Delete All", command = t1.delete(1.0, "end"))
demo = total_window()
Executing the above code, The delete button is not working at all, I want my delete button to delete all the contents in the text widget,
Any links to what is the issue here.