-
Notifications
You must be signed in to change notification settings - Fork 10
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
Default value bug #33
Comments
Hi @Akascape, A possible solution for the issue I mentioned yesterday is as follows. Kindly verify if this is a fix. Problem: Fix: The init() method:
The updated _attach_key_press() method is:
The updated code from my inital comment would be:
This will now execute the command I've defined in my code and update the dropdown with the option I selected. Hopefully this helps :) |
Thanks, this fix works, but i recommend to put the _attach_key_press would look like this:
|
But we can also simply use the .set method: from CTkScrollableDropdown import *
import customtkinter
root = customtkinter.CTk()
def hello(e):
hellos = {"Italy": "Ciao",
"Germany": "Hallo",
"England": "Hello"}
print(hellos[e])
country_options.set(e)
countries = ["Italy", "Germany", "England"]
country_options = customtkinter.CTkComboBox(root)
country_options.pack()
CTkScrollableDropdown(attach=country_options, values=countries, autocomplete=True, alpha=1, command=hello)
root.mainloop() |
Hi @Akascape,
I've noticed that when adding a command to the dropdown the command executes but the dropdown no longer updates showing the user which value was selected. For example:
This will print the correct hello for each selected language but the dropdown does not update to the chosen language.
The text was updated successfully, but these errors were encountered: