Python Forum
[Tkinter] listbox selection
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] listbox selection
#1
Hi,
I have a listbox for MULTIPLE selection.
def getElement(event):
    selection = event.widget.curselection()
the variable "selection" becomes a vector as you select more lines. OK.
Like so:
Output:
(10, 11, 12, 15)
My question: "selection" gets sorted automatically, for every line you click.
The information of which line was selected first is lost. (Especially the first selection)
Yes, I can create a new variable to save this info, it would be nicer if I can prevent it from sorting.
thx,
Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply


Messages In This Thread
listbox selection - by DPaul - May-16-2022, 09:30 AM
RE: listbox selection - by deanhystad - May-16-2022, 05:14 PM
RE: listbox selection - by DPaul - May-16-2022, 05:32 PM
RE: listbox selection - by deanhystad - May-16-2022, 06:12 PM
RE: listbox selection - by DPaul - May-17-2022, 06:38 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020