Tkinter: select multiple entries in Listbox widget?

B

Bernard Lebel

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
 
R

Rob Williscroft

Bernard Lebel wrote in (e-mail address removed) 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-preserver/ClassListbox.html

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

Rob.
 
B

Bernard Lebel

Oh, thanks a lot Rob.


Bernard



Bernard Lebel wrote in (e-mail address removed) in comp.lang.python:


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-preserver/ClassListbox.html

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

Rob.
 
S

SuperHik

Rob said:
Bernard Lebel wrote in (e-mail address removed) in comp.lang.python:


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-preserver/ClassListbox.html

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

Rob.
cool.
never needed it so far but it's nice to know :D
 

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

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top