Open xwydq opened 1 year ago
Try using .configure()
combo.confugure(values=combo_value_list)
Try using .configure()
combo.confugure(values=combo_value_list)
tks!! but CTkComboBox is not support select multiple values. Is there a way to achieve it?
What you you mean?
import customtkinter
import random
root = customtkinter.CTk()
combo_value_list = ["Apple", "Banana", "Orange"]
combo = customtkinter.CTkComboBox(root, values=combo_value_list)
combo.pack()
# Update the combo values list
print(combo)
combo_value_list.append("Grapes")
combo.configure(values= combo_value_list)
def update_list():
random_list = [str(random.randint(0, 9)) for x in range(10)]
combo.configure(values= random_list)
customtkinter.CTkButton(root, text="Update list", command=update_list).pack()
root.mainloop()
Seems to work fine.
I mean CTkComboBox not support multiple values be selected
cannot update CTkComboBox values list. but it is ok for tkinter.ttk