You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title=Label(self.root,text="SEARCH and EDIT",font=("times new roman",35,"bold"),bg="white",fg="black").place(x=0,y=0,relwidth=1)
13
+
14
+
frame1=Frame(self.root,bd=2,relief=RIDGE)
15
+
frame1.place(x=20,y=130,width=1330,height=550)
16
+
17
+
self.var_search=StringVar()
18
+
txt_word=Entry(self.root,textvariable=self.var_search,font=("times new roman",20)).place(x=100,y=82,width=500)
19
+
20
+
btn_search=Button(self.root,text="Search",command=self.searchword,font=("times new roman",15,"bold"),bg="#262626",fg="white").place(x=620,y=80,height=40,width=120)
21
+
btn_clear=Button(self.root,text="Clear",command=self.clear,font=("times new roman",15,"bold"),bg="#262626",fg="white").place(x=750,y=80,height=40,width=120)
22
+
btn_enable=Button(self.root,text="Enable Editor",command=self.enable,font=("times new roman",15,"bold"),bg="#262626",fg="white").place(x=880,y=80,height=40,width=210)
23
+
btn_disable=Button(self.root,text="Disable Editor",command=self.disable,font=("times new roman",15,"bold"),bg="#262626",fg="white").place(x=1100,y=80,height=40,width=210)
24
+
25
+
scrolly=Scrollbar(frame1,orient=VERTICAL)
26
+
scrolly.pack(side=RIGHT,fill="y")
27
+
28
+
self.txt_area=Text(frame1,font=("times new roman",15),yscrollcommand=scrolly.set)
29
+
self.txt_area.pack(fill=BOTH,expand=1)
30
+
scrolly.config(command=self.txt_area.yview)
31
+
32
+
defenable(self):
33
+
self.txt_area.config(state=NORMAL)
34
+
35
+
defdisable(self):
36
+
self.txt_area.config(state=DISABLED)
37
+
38
+
defclear(self):
39
+
self.var_search.set("")
40
+
self.txt_area.delete('1.0',END)
41
+
42
+
defsearchword(self):
43
+
ifself.var_search.get()=="":
44
+
messagebox.showerror("ERROR","Search box shouldn't be empty")
0 commit comments