When i try clicking on the left listbox, it only highlights in blue the right one. How do i make it highlight both listbox's?
from Tkinter import *
root=Tk()
scrollbar = Scrollbar(root)
scrollbar.pack( side = RIGHT, fill=Y )
mylist = Listbox(root, yscrollcommand = scrollbar.set )
for line in range(100):
mylist.insert(END, "This is line number " + str(line))
mylist.pack( side = RIGHT, fill = BOTH )
mylist2 = Listbox(root, yscrollcommand = scrollbar.set )
for line in range(100):
mylist2.insert(END, "This is line number " + str(line))
mylist2.pack( side = RIGHT, fill = BOTH )
def scroll_bar(*args):
mylist.yview(*args)
mylist2.yview(*args)
scrollbar.config( command = scroll_bar )
def side_highlight(e):
select_number= mylist2.curselection() #gets where in listbox is selected
mylist.selection_set(select_number)
mylist2.bind('<<ListboxSelect>>', side_highlight)
root.mainloop()