i wanted to know if it's possible to move to a specific position in a text widget in tkinter. I implemented search in text widget and wanted to implement "next" and "previous" methods for my search to move across the text widget. Is it possible to do? Thanks for any help.
Here is a code for my method:
def find():
xml.tag_delete("search")
xml.tag_configure("search", background="green")
start="1.0"
if len(fi.get()) > 0:
xml.mark_set("insert", xml.search(fi.get(), start))
while True:
pos = xml.search(fi.get(), start, END)
if pos == "":
break
start = pos + "+%dc" % len(fi.get())
xml.tag_add("search", pos, "%s + %dc" % (pos,len(fi.get())))
fi is an entry field for search pattern. xml is a text field.