I am making a UI using tkinter. I have a text box in which the user can write multiple lines. I need to search those lines for certain words and highlight them.
Currently, when I search for a word and try to color it using tag_configure
and tag_add
, I get an error, "bad index".
What I've learned after reading certain pages on internet is that the start and end indices used in tag_add
are those of the format row.column
(please correct me if I am going wrong somewhere).
Can anyone help me in getting the index in this format from the tkinter UI directly for highlighting? Thank you in advance!