Tkinter: Selecting one item in each of two listboxes

Discussion in 'Python' started by Jeffrey Barish, Apr 19, 2004.

  1. 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()
     
    Jeffrey Barish, Apr 19, 2004
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.