Senario:
main window -> button click -> create CTkToplevel window -> CTkRadioButton -> CTkToolTip for CTkRadioButton
When hovering over the RadioButton in the popup window, the main window gets elevated.
The ToolTip is displayed properly.
When closing the pop up window invalid command name error:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/customtkinter/windows/widgets/core_rendering/draw_engine.py", line 137, in __draw_rounded_rect_with_border_polygon_shapes if not self._canvas.find_withtag("border_parts"): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tkinter/__init__.py", line 2923, in find_withtag return self.find('withtag', tagOrId) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tkinter/__init__.py", line 2890, in find self.tk.call((self._w, 'find') + args)) or () ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _tkinter.TclError: invalid command name ".!tabview.!ctktoplevel.!backupcreateview.!ctkframe.!canvas.!ctkscrollableframe.!ctkradiobutton52.!ctkcanvas2"
I was seeing similar behavior on macOS. Removing self.master from the following line or commenting it out completely resolved the issue for me. I'm not sure if this change will cause inadvertent side effects.
Senario: main window -> button click -> create CTkToplevel window -> CTkRadioButton -> CTkToolTip for CTkRadioButton
When hovering over the RadioButton in the popup window, the main window gets elevated. The ToolTip is displayed properly. When closing the pop up window
invalid command name
error:^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/customtkinter/windows/widgets/core_rendering/draw_engine.py", line 137, in __draw_rounded_rect_with_border_polygon_shapes if not self._canvas.find_withtag("border_parts"): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tkinter/__init__.py", line 2923, in find_withtag return self.find('withtag', tagOrId) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tkinter/__init__.py", line 2890, in find self.tk.call((self._w, 'find') + args)) or () ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _tkinter.TclError: invalid command name ".!tabview.!ctktoplevel.!backupcreateview.!ctkframe.!canvas.!ctkscrollableframe.!ctkradiobutton52.!ctkcanvas2"