CustomTkinter
CustomTkinter copied to clipboard
Selected text coloring
Hi!
As the subject expose I am interested in changing the color of the selected text in the CTkTextbox. There is no such variable but maybe someone found a workaround? Otherwise it would be a nice add. Thanks for great contribution with this set of custom tkinter widgets.
Best regards InfiniteTesch
import customtkinter as ctk
def set_selection_color(ctk_textbox, bg_color, fg_color): ctk_textbox._textbox.tag_configure("sel", background=bg_color, foreground=fg_color)
window = ctk.CTk()
ctk_textbox = ctk.CTkTextbox(window) ctk_textbox.pack()
ctk_textbox.insert("1.0", "Hello, World!") set_selection_color(ctk_textbox, bg_color="red", fg_color="white")
window.mainloop()
:-)