CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

kEventMenuPopulate to menu '.!ctkframe.!ctkoptionmenu.!dropdownmenu' when clicking on OptionMenu widget

Open MrBananaPants opened this issue 2 years ago • 2 comments

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()

MrBananaPants avatar Dec 01 '22 13:12 MrBananaPants

Are you on Windows? For me the example is working fine.

TomSchimansky avatar Dec 01 '22 20:12 TomSchimansky

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.

MrBananaPants avatar Dec 02 '22 14:12 MrBananaPants

Can't reproduce this on macOS Monterey with python3.11. But I will update to Ventura soon and then test this again.

TomSchimansky avatar Dec 06 '22 17:12 TomSchimansky

For whatever reason, this issue doesn't happen for me anymore. Closing for now.

MrBananaPants avatar Dec 06 '22 17:12 MrBananaPants