-
-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add options to listbox data #1236
Comments
I have this issue as well. The listbox documentation does not seem to provide a canonical way to reference the selected item directly either by identity or by index. |
The Pull Request hasn't been merged, why is this closed ? |
It was closed as part of a general clean up, as the number of issues was exceeding the developer time and issues were prioritized. I have flagged the PR today, so maybe it will be picked up again. In the meantime, you could see if the following example offers any interesting workarounds for you. https://github.com/hoffstadt/DearPyGui/wiki/Tools-and-Widgets#dpg-swiss-controls |
Is your feature request related to a problem? Please describe.
When I click on an item in a listbox the data being sent to the callback function is just the string of the item, this is perfectly fine when you have items with unique strings. In my instance I'm using the listbox to display a list of transactions and some of them have identical string names, and then I don't know exactly which of those transactions was selected.
Describe the solution you'd like
I think that one of the following would suffice to solve the problem:
Describe alternatives you've considered
At the moment my solution is just adding the id number in the items string, that works because I can extract the id from the string but the downside is that the id is displayed.
Additional context
Here's a minimal example showing that I don't know which of "item1" was clicked.
The text was updated successfully, but these errors were encountered: