Color substring of text among Textbox #1603
Replies: 3 comments 6 replies
-
Works fine, but the method is called import customtkinter
app = customtkinter.CTk()
text_widget = customtkinter.CTkTextbox(app)
text_widget.pack()
text_widget.insert('end', 'This is some colored text.\n')
text_widget.tag_add('color', '1.5', '1.11') # '1.5' means first line, 5th character; '1.11' means first line, 11th character
text_widget.tag_config('color', foreground='red')
app.mainloop() |
Beta Was this translation helpful? Give feedback.
-
Could you explain how I color substrings of a Thanks in advance |
Beta Was this translation helpful? Give feedback.
-
Hi,
I can create multiple tags to generate different styles, but unable to add bold and italics as tag_config does not support it. Any help will be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
-
Hello,
is there a possibility to color just a substring of the text inside a
customtinker.Textbox
? Or highlight it otherwise?In plain tkinter this is possible like so:
However customtinker only provides the
text_color
parameter, which colors the whole Text.Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions