[Tkinter] CTkScrollableDropdown error: bad window path name ".!ctkscrollabledropdown" - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: GUI (https://python-forum.io/forum-10.html) +--- Thread: [Tkinter] CTkScrollableDropdown error: bad window path name ".!ctkscrollabledropdown" (/thread-41697.html) |
CTkScrollableDropdown error: bad window path name ".!ctkscrollabledropdown" - CopperGenie - Mar-03-2024 Hello! I'm using tkinter, customtkinter (ctk), and CTkScrollableDropdown (ctksd). This last library adds the ability to easily implement scrollable dropdown menus to various ctk elements. I followed ctksd's installation instructions, imported the library, and called the CTkScrollableDropdown class after my ctk element like in their example. However, I'm getting this error after I delete the widget. The error keeps spamming with every interaction with the GUI thereafter. MRE:import tkinter as tk import customtkinter as ctk import CTkScrollableDropdown as ctksd def clear_screen_widgets(): # deletes all present widgets widgets = root.winfo_children() # Get a list of all the widgets in root for widget in widgets: widget.destroy() def goto_screen_client_info_2(values): clear_screen_widgets() root = ctk.CTk() combobox_client_info_1 = ctk.CTkComboBox(master=root, values='foo') combobox_client_info_1.place(relx=0.5, rely=0.33, relwidth=.4, anchor=tk.CENTER) combobox_client_info_1.bind("<Return>", goto_screen_client_info_2) # run command when enter key is pressed ctksd.CTkScrollableDropdown(combobox_client_info_1, values='foo', justify="left", button_color="transparent", autocomplete=True) root.mainloop()I suspect this might have to do with the fact that no parent is passed to CTkScrollableDropdown. Any ideas? Is there a safer method for deleting a widget that doesn't lead to this error? RE: CTkScrollableDropdown error: bad window path name ".!ctkscrollabledropdown" - deanhystad - Mar-03-2024 You should post your issue with the package on github. It appears to work ok as long as you don't try to delete the dropdown window. There is no problem with deleting the combobox. Why are you deleting widgets anyway? |