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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • todem2020
    New Member
    • Jan 2020
    • 1

    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.

    Code:
            for elt in result1:
                userliste1.append(elt[1]+" "+elt[2])
    
            for elt in result2:
                userliste2.append(elt[1]+" "+elt[2])
    
            result=[checkuser1 + ' '+ value for value in userliste1 if value not in userliste2]+[checkuser2+ ' '+ value for value in userliste2 if value not in userliste1]
            if len(result)==0:
                w.BenutzerVergleichUserStatusLabel(text=getMessage('9003'))
                return 
                
            for row in result :
                w.BenutzerVergleichProfileListbox.insert(tk.END, row[:8]+ ' : ' + row[8:])            
                w.BenutzerVergleichProfileListbox.itemconfig(2, fg='red')
    Last edited by gits; Jan 20 '20, 10:25 AM. Reason: added code tags
  • dwblas
    Recognized Expert Contributor
    • May 2008
    • 626

    #2
    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,

    Comment

    Working...