How to move insert to position in Text widget (Tkinter)

Harlin Seritt harlinseritt at yahoo.com
Fri Mar 25 06:56:58 EST 2005


I am working on a Find Text dialog box. Once you find a string in a
Text widget, how do you at least move the cursor to that index
(position)? Even better how can one 'select' the string one finds?

---code---
def searchText():
            while 1:
                pos = self.mainEdit.search(findString.get(), 1.0,
stopindex=END)
                if not pos:
                    break

                print pos
                start = pos + "+1c"
                break
---end code---

thanks,

Harlin Seritt




More information about the Python-list mailing list