Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 176163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:49:40+00:00 2026-05-11T13:49:40+00:00

from Tkinter import * master = Tk() listbox = Listbox(master) listbox.pack() listbox.insert(END, a list

  • 0
from Tkinter import *   master = Tk()  listbox = Listbox(master) listbox.pack() listbox.insert(END, 'a list entry')  for item in ['one', 'two', 'three', 'four']:     listbox.insert(END, item)  listbox2 = Listbox(master) listbox2.pack() listbox2.insert(END, 'a list entry')  for item in ['one', 'two', 'three', 'four']:     listbox2.insert(END, item)  master.mainloop() 

The code above creates a tkinter window with two listboxes. But there’s a problem if you want to retrieve the values from both because, as soon as you select a value in one, it deselects whatever you selected in the other.

Is this just a limitation developers have to live with?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T13:49:40+00:00Added an answer on May 11, 2026 at 1:49 pm

    Short answer: set the value of the exportselection attribute of all listbox widgets to False or zero.

    From a pythonware overview of the listbox widget:

    By default, the selection is exported to the X selection mechanism. If you have more than one listbox on the screen, this really messes things up for the poor user. If he selects something in one listbox, and then selects something in another, the original selection is cleared. It is usually a good idea to disable this mechanism in such cases. In the following example, three listboxes are used in the same dialog:

    b1 = Listbox(exportselection=0) for item in families:     b1.insert(END, item)  b2 = Listbox(exportselection=0) for item in fonts:     b2.insert(END, item)  b3 = Listbox(exportselection=0) for item in styles:     b3.insert(END, item) 

    The definitive documentation for tk widgets is based on the Tcl language rather than python, but it is easy to translate to python. The exportselection attribute can be found on the standard options manual page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 137k
  • Answers 137k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The other answers give you linear interpolations -- these don't… May 12, 2026 at 7:19 am
  • Editorial Team
    Editorial Team added an answer Out of date Spring no longer supports JDO Spring JDO… May 12, 2026 at 7:19 am
  • Editorial Team
    Editorial Team added an answer I believe what you're looking for is MetadataTypeAttribute. This isn't… May 12, 2026 at 7:19 am

Related Questions

I'm writing some code in python and I'm having trouble when trying to retrieve
Playing around with Python - tkInter - Entry widget - when I use validatecommand
I've created this simple GUI: from tkinter import * root = Tk() def grabText(event):
I want to spawn another process to display an error message asynchronously while the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.