Tkinter: Selecting one item in each of two listboxes

J

Jeffrey Barish

I have an application that produces two listboxes. I would like to be
able to select one of the items in the first listbox and one of the
items in the second listbox. However, when I make my selection in the
second listbox, the selected item in the first listbox gets deselected.
Is there a way to do this? I tried setting selectmode to MULTIPLE, but
that option only allows me to select multiple items in one of the
listboxes (both of which get deselected when I make a selection in the
second listbox).

I create the listboxes as follows:

listbox1_frame = Frame(root)
listbox1_frame.pack()
listbox1 = Listbox(listbox1_frame, width = 40, height = 12)
listbox1.pack()

listbox2_frame = Frame(root)
listbox2_frame.pack()
listbox2 = Listbox(listbox2_frame, width = 40, height = 8)
listbox2.pack()
 

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

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top