473,416 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Tkinter: select multiple entries in Listbox widget?

Hello,

Is there an option or a way to allow the selection of multiple entries
in the Listbox widget? I could not find any, and would like to allow
the end user to select multiple entries.
Thanks
Bernard
Jun 1 '06 #1
3 11221
Bernard Lebel wrote in news:mailman.6413.1149178158.27775.python-
li**@python.org in comp.lang.python:
Hello,

Is there an option or a way to allow the selection of multiple entries
in the Listbox widget? I could not find any, and would like to allow
the end user to select multiple entries.


When configuring use:

selectmode = "multiple"

e.g.:

import Tkinter as tk

root = tk.Tk()

a = tk.Listbox( root, selectmode = "multiple" )
for i in range(10):
a.insert( i, str(i) + " item" )

a.pack()
root.mainloop()

I found the answer here:

http://www.python.org/doc/life-prese...ssListbox.html

Though I had to guess the `= "multiple"` part.

Rob.
--
http://www.victim-prime.dsl.pipex.com/
Jun 1 '06 #2
Oh, thanks a lot Rob.
Bernard

On 6/1/06, Rob Williscroft <rt*@freenet.co.uk> wrote:
Bernard Lebel wrote in news:mailman.6413.1149178158.27775.python-
li**@python.org in comp.lang.python:
Hello,

Is there an option or a way to allow the selection of multiple entries
in the Listbox widget? I could not find any, and would like to allow
the end user to select multiple entries.


When configuring use:

selectmode = "multiple"

e.g.:

import Tkinter as tk

root = tk.Tk()

a = tk.Listbox( root, selectmode = "multiple" )
for i in range(10):
a.insert( i, str(i) + " item" )

a.pack()
root.mainloop()

I found the answer here:

http://www.python.org/doc/life-prese...ssListbox.html

Though I had to guess the `= "multiple"` part.

Rob.
--
http://www.victim-prime.dsl.pipex.com/
--
http://mail.python.org/mailman/listinfo/python-list

Jun 1 '06 #3
Rob Williscroft wrote:
Bernard Lebel wrote in news:mailman.6413.1149178158.27775.python-
li**@python.org in comp.lang.python:
Hello,

Is there an option or a way to allow the selection of multiple entries
in the Listbox widget? I could not find any, and would like to allow
the end user to select multiple entries.


When configuring use:

selectmode = "multiple"

e.g.:

import Tkinter as tk

root = tk.Tk()

a = tk.Listbox( root, selectmode = "multiple" )
for i in range(10):
a.insert( i, str(i) + " item" )

a.pack()
root.mainloop()

I found the answer here:

http://www.python.org/doc/life-prese...ssListbox.html

Though I had to guess the `= "multiple"` part.

Rob.

cool.
never needed it so far but it's nice to know :D
Jun 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Patrick L. Nolan | last post by:
Our Tkinter application has a big ScrolledText widget which is a log of everything that happens. In order to prevent people from making changes, we have it in DISABLED mode except when the...
2
by: Tonino | last post by:
Hi, I have a small Tkinter app that gets data from a socket connection to a "server". The app has a Text() widget to display the info that it gets from the socket connection. I have the...
3
by: groves | last post by:
hi eveyrbody , i have started working on python tkinter, While I was working on one of the tkinter classes..named listbox widget. I had a slight problem. Now let me tell you that i was able to...
3
by: vedran_dekovic | last post by:
Hi, I need help about Tkinter listbox widget.I want,when somebody click on any item(file) in Listbox,then in new Label widget text must be selected item from server. my program (wrong...
0
by: Svenn Bjerkem | last post by:
Hi, Armed with Programming Python 3rd Edition and Learning Python 2nd edition I try to write an application which I at first thought was simple, at least until I was finished with the GUI and...
32
by: Kevin Walzer | last post by:
I'm a Tcl/Tk developer who has been working, slowly, at learning Python, in part because Python has better support for certain kinds of applications that I want to develop than Tcl/Tk does....
6
by: Gigs_ | last post by:
I'm writing text editor. How to enable/disable (cut, copy etc.) when text is selected/not selected
2
by: Ben Collver | last post by:
I am using Darwin 10.4.9, tcl 8.4.7, tk 8.4, and python 2.3.5. I have also tried Python 2.5 on Darwin, Debian, and Fedora Core 6. I am working on a GUI front-end to a Python program of mine. It...
6
by: rahulnag22 | last post by:
Hi, Is it possible to have different items in a listbox in different colors? Or is it just one color for all items in a listbox? Thanks Rahul
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.