-1

From this answer I know how to color individual items in a listbox. However, is it possible to color individual words/characters inside the item of a Tkinter listbox?

If yes, how to achieve that?

If no, is there a way to work around the limitations, such as transforming a Tkinter TextBox into a ListBox (so you can click on individual lines), while still being able to color anything and everything?

1 Answer 1

0

You cannot change individual words in a Listbox widget. Your only choices are to use a Text widget or a Canvas widget, with the Text widget by far being the easiest.

You can certainly use the Text widget as the basis for replicating the features of the Listbox. You'll have to add your own bindings for selecting whole lines, and add your own methods and virtual events to emulate the Listbox.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.