CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

Invalid command name

Open kohinoor12 opened this issue 1 year ago • 7 comments

invalid command name "1806550247616update" while executing "1806550247616update" ("after" script) invalid command name "1806550247232check_dpi_scaling" while executing "1806550247232check_dpi_scaling" ("after" script)

self.win = customtkinter.CTk()

When generating a new window immediately after closing the previous one, the above message is generated on the console but the code works fine without any error can you please solve this as some people consider it as an error

kohinoor12 avatar Feb 17 '24 12:02 kohinoor12

Description:

This is caused because the window is instantiated to be looped after the initial window has been destroyed. Something like this:

window.destroy()
anotherwindow.mainloop()

Solution:

To avoid this you can make use of CTkTopLevel or create multiple CTkFrame widgets instead of windows and move back and fourth in them.

AshhadDevLab avatar Feb 19 '24 09:02 AshhadDevLab

If this answers your question mark it as solved!

AshhadDevLab avatar Feb 21 '24 17:02 AshhadDevLab

Exception ignored in: <function Variable.del at 0x0000017B96258A60> Traceback (most recent call last): File "AppData\Local\Programs\Python\Python39\lib\tkinter_init_.py", line 363, in del if self._tk.getboolean(self._tk.call("info", "exists", self._name)): RuntimeError: main thread is not in main loop

I am getting this message in the console but the application still works fine but if the message comes more then 8-10 times then the application crashes

kohinoor12 avatar Feb 21 '24 18:02 kohinoor12

Did you try my solution?

AshhadDevLab avatar Feb 21 '24 18:02 AshhadDevLab

Yes that issue is resolved now, in my application I have a popup window that works as a preloader when different functions been called that time I'm getting the above message

kohinoor12 avatar Feb 21 '24 18:02 kohinoor12

instead of destroying the window withdraw it first and after the other window is loaded destroy it

AshhadDevLab avatar Feb 21 '24 19:02 AshhadDevLab

can you somehow give a minimal reproducible code

AshhadDevLab avatar Feb 21 '24 19:02 AshhadDevLab