Closed bndkti closed 4 months ago
The function curselection()
already return the index of the selected option.
An example is:
index = listbox.curselection()
value = listbox.get(index)
Keep in mind, that this example works when the user cannot select multiple options, however if you want multiple selection curselection()
will return the indexes of the selected options.
Great Listbox! I've got a issue with the curselection in my project. It is very simple, i want to select an item of the listbox and the selected item have to show in an entry digit. But it doesen't work. How is the code, to get the value from the index?
My try: index = list.curselection()[0] value = list.get(index)