-1
Hello! I am studying about Tkinter and I would like to know if it has how to make the two Listbox that I create, have synchronized selection, and also if it is possible to do the same thing with the scroll bar
Thanks in advance.
from tkinter import *
root = Tk()
root.geometry("500x500")
scroll=Scrollbar(root)
scroll.place(x=300,y=90)
listbox = Listbox(root,exportselection=0)
listbox.insert(END, "Selecione")
listbox.config(yscrollcommand=scroll.set)
listbox.place(x=50,y=70)
for item in ["1", "2", "3", "4"]:
listbox.insert(END, item)
scroll2=Scrollbar(root)
scroll2.place(x=330,y=90)
listbox2 = Listbox(root,exportselection=0)
listbox2.pack()
listbox2.insert(END, "Selecione")
listbox2.config(yscrollcommand=scroll2.set)
listbox2.place(x=175,y=70)
for item in ["1", "2", "3", "4"]:
listbox2.insert(END, item)
root.mainloop()