how would you write this function in non oop
def highlight(self, seq):
if "highlight" in self.textWidget.tag_names():
self.textWidget.tag_delete("highlight")
i = len(seq)
idx = "1.0"
while True:
idx = self.textWidget.search(seq, idx, nocase=1, stopindex='end')
if idx:
idx2 = self.textWidget.index("%s+%dc" % (idx, i))
self.textWidget.tag_add("highlight", idx, idx2)
self.textWidget.tag_config("highlight", background="yellow")
idx = idx2
else: return