473,756 Members | 8,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 11278
Bernard Lebel wrote in news:mailman.64 13.1149178158.2 7775.python-
li**@python.org in comp.lang.pytho n:
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.64 13.1149178158.2 7775.python-
li**@python.org in comp.lang.pytho n:
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.64 13.1149178158.2 7775.python-
li**@python.org in comp.lang.pytho n:
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
5326
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 program wants to write a new entry. This works OK, except that sometimes we want to copy out of piece of the contents and paste it in another window. When it's DISABLED, it appears that we can't even select a portion of the text. Is this an...
2
2951
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 ability to stop the text at any point. What I want to be able todo is select a line from the Text() window and double click or whatever on it to open a new window with that selected text as a paramater to the new window.
3
1327
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 create a simple listbox which had 6 options which one can select, but Now what I want is that from the available menu, if I select an option it should give me another menu associated with that option. Its like digging up that option to do advance...
3
2581
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 example): import ftputil import Tkinter root=Tkinter.Tk()
0
1425
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 then wanted to start putting some data into it. As you will see, the program is not yet finished but I post what I have so far.
32
7490
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. Naturally, I thought that I would use Tkinter as the GUI for these programs. However, in doing research into GUI development techniques, sample code, and showcase applications, what has struck me is how little sophisticated GUI development seems to be...
6
3538
by: Gigs_ | last post by:
I'm writing text editor. How to enable/disable (cut, copy etc.) when text is selected/not selected
2
1760
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 is a simple grid with labels in the left column and input widgets in the right column. One of the rows has a listbox in the right column. The listbox contains two items. I select one using widget.select_set(). The GUI is not complete yet,...
6
20036
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
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9713
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8713
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.