When I want to output colorized string (red color) in terminal I use:
puts "\033\[00;31m Test String \033\[0m"
But when I print this string in text widget I get:
[00;31m Test String [0m
How to print the same colorized string in text widget?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As far as I understand the question it is about applying formatting to content of text widget which has to do with Tk and not with escape sequences. This can be achieved through tags. Here is the code that would create a text widget, put two lines into it and highlight the second line with red.
I hope this helps if the question is just about formatting.
PN