473,405 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

tkinter-listbox-different-text-colors-one-listbox

hi,

tkinter-listbox-different-text-colors-one-listbox. I try to write each user with a different color to be able to differentiated. I always get the same error when I run the following code.

Expand|Select|Wrap|Line Numbers
  1.         for elt in result1:
  2.             userliste1.append(elt[1]+" "+elt[2])
  3.  
  4.         for elt in result2:
  5.             userliste2.append(elt[1]+" "+elt[2])
  6.  
  7.         result=[checkuser1 + ' '+ value for value in userliste1 if value not in userliste2]+[checkuser2+ ' '+ value for value in userliste2 if value not in userliste1]
  8.         if len(result)==0:
  9.             w.BenutzerVergleichUserStatusLabel(text=getMessage('9003'))
  10.             return 
  11.  
  12.         for row in result :
  13.             w.BenutzerVergleichProfileListbox.insert(tk.END, row[:8]+ ' : ' + row[8:])            
  14.             w.BenutzerVergleichProfileListbox.itemconfig(2, fg='red')
Jan 20 '20 #1
1 1435
dwblas
626 Expert 512MB
I always get the same error when I run the following code
For those of us without chrystal balls, what is the error. Post the complete traceback. I find it easy to get examples from the web as bg and fg are standard config options like all widgets,
Jan 20 '20 #2

Sign in to post your reply or Sign up for a free account.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.