Open gitseba4 opened 2 years ago
@gitseba4, can you explain more what this would look like? Are you displaying the value, but the selection is associated with a key?
Exactly, for the example above it would look like this:
When we select the Seat item the vehicle_brand_sv variable should return 2 or optionally (2, 'Seat').
print(vehicle_brand_sv.get()) => 2
print(vehicle_brand_sv.get()) => (2, 'Seat')
I'll add this to the roadmap on Version 2.0 which I'm working on now.
Is your feature request related to a problem? Please describe.
For some widgets eg Combobox or Spinbox I've an idea to add to support dictionaries for values field. Currently it's only possible for tuples or lists. A dictionary would be perfect for working with databases.
Describe the solution you'd like
For example we have the following code snippet:
For this case the combobox shows only dictionary-values, but the textvariable returns dictionary-key (alternatively key-value pair). For tuples or lists it works the old way.
Describe alternatives you've considered
In stackoverflow I found few alternatives:
But each of these solutions is inconvenient to use.
Additional context
No response