Tk: changing color of an item in a TkListbox

P

Patrick Gundlach

Hello out there,

I have a TkListbox with several items, and I'd like to change the
color for eg. the second item. How would I accomplish that? I can't
get the configure method to accept a value for the index, but this
seems to me the way to proceed. Any ideas?

Thanks,

Patrick
 
P

Patrick Gundlach

self follow-up:
I have a TkListbox with several items, and I'd like to change the
color for eg. the second item. How would I accomplish that? I can't
get the configure method to accept a value for the index, but this
seems to me the way to proceed. Any ideas?


The solution is to use

list.itemconfigure(index, :foreground => "red")

Sorry for the noise,

Patrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,183
Messages
2,570,968
Members
47,517
Latest member
TashaLzw39

Latest Threads

Top