CustomTkinter
CustomTkinter copied to clipboard
kEventMenuPopulate to menu '.!ctkframe.!ctkoptionmenu.!dropdownmenu' when clicking on OptionMenu widget
I just converted my app to CustomTkinter v5.0.1 but when I click on the OptionMenu widget to show me the options, I get a kEventMenuPopulate to menu '.!ctkframe.!ctkoptionmenu.!dropdownmenu'
error and the app starts behaving very weirdly after.
Here's some code to reproduce the error:
import customtkinter as ctk
def get_values():
return ["option 1", "option 2", "option 3"]
def menu_selection(choice):
print(f"selected {choice}")
app = ctk.CTk()
app.geometry("400x200")
app.title("CustomTkinter")
main_frame = ctk.CTkFrame(app, fg_color=("#f2f2f2", "#202020"))
main_frame.pack(anchor="w", fill="both", expand=True)
select_option = ctk.CTkOptionMenu(master=main_frame, width=150, fg_color="#3C99DC", text_color=("black", "white"), dynamic_resizing=False,
values=get_values(),
command=menu_selection)
select_option.place(relx=0.5, rely=0.5, anchor=ctk.CENTER)
app.mainloop()
Are you on Windows? For me the example is working fine.
I'm on macOS Ventura (using Python 3.11)
Edit: I just tried it on another Mac running Monterey and there it doesn't happen.
Can't reproduce this on macOS Monterey with python3.11. But I will update to Ventura soon and then test this again.
For whatever reason, this issue doesn't happen for me anymore. Closing for now.