Akascape / CTkScrollableDropdown

Easily add a new scrollable dropdown menu in customtkinter widgets (extension/add-on)
MIT License
110 stars 10 forks source link

Font setting ignored if values changed via configure method #41

Closed nexperion closed 4 months ago

nexperion commented 5 months ago

If the values list is changed via the configure method, the font attribute set in the constructor is not applied any longer:

from CTkScrollableDropdown import *
import customtkinter

root = customtkinter.CTk()

customtkinter.CTkLabel(root, text="Different Dropdown Styles").pack(pady=5)

# Some option list
values = ["python","tkinter","customtkinter","widgets",
          "options","menu","combobox","dropdown","search"]

# Attach to OptionMenu
optionmenu = customtkinter.CTkOptionMenu(root, width=240)
optionmenu.pack(fill="x", padx=10, pady=10)

dropdown = CTkScrollableDropdown(optionmenu, values=['something'], font=('Ubuntu', 14))

dropdown.configure(values=values)

root.mainloop()

If in the same example, configure is not called, the font is applied correctly.