Mar-28-2019, 08:45 AM
then you must search for it by content.
There's no way to colorize something without knowing what and where it is located.
The only part of the example I posted that you need for your program is the function:
There's no way to colorize something without knowing what and where it is located.
The only part of the example I posted that you need for your program is the function:
# adding a tag to a part of text specifying the indices def highlight_text(tag_name, lineno, start_char, end_char, bg_color=None, fg_color=None): txtwidget.tag_add(tag_name, f'{lineno}.{start_char}', f'{lineno}.{end_char}') txtwidget.tag_config(tag_name, background=bg_color, foreground=fg_color)There must be an anchor you can search for, right?