Python Forum
General Listbox question. - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: General Listbox question. (/thread-29485.html)



General Listbox question. - Milfredo - Sep-05-2020

I can not find any videos or text telling me how to take a listbox item and place the text into a variable when user selects an item in the Listbox.

Thank you.


RE: General Listbox question. - Larz60+ - Sep-05-2020

I'm assuming you're using tkinter
I wrote this 4 years ago, but code should still be OK: https://python-forum.io/Thread-Show-Installed-Package-detail?highlight=tkinter
It uses a Treeview, but the bindings are very similar to a ListBox


RE: General Listbox question. - Milfredo - Sep-05-2020

Thank you.


RE: General Listbox question. - Larz60+ - Sep-05-2020

FYI: Here's a link to a most useful tkinter reference manual: https://users.tricity.wsu.edu/~bobl/cpts481/tkinter_nmt.pdf
It's dated but so is tkinter, so perfectly OK


RE: General Listbox question. - Milfredo - Sep-06-2020

Thank you Larz.