Tkinter Text widget incremental search

B

Bob Greschke

I want to create a search function on a Text() widget full of text like the
incremental search in emacs -- if you type an "f" emacs goes to the first
"f", type another "f" and it goes to the first place where "ff" shows up in
the text, etc.

How would you search the text of the Text() for a string like "ff" and get
back the proper index position (line.char) AND have that take into account
word wrapping? Text().get(0.0, END).split("\n") returns a bunch of lines,
but one line in the List may be many text widget/screen lines.

Thanks!

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top