By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,276 Members | 1,951 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,276 IT Pros & Developers. It's quick & easy.

Tkinter: select multiple entries in Listbox widget?

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.