CTkToolTip icon indicating copy to clipboard operation
CTkToolTip copied to clipboard

ToolTip elevates main window when used in CTkToplevel window

Open Dominik-esb opened this issue 2 years ago • 1 comments

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"

Screenshot 2023-12-17 at 19 29 42 Screenshot 2023-12-17 at 19 29 53

Dominik-esb avatar Dec 17 '23 19:12 Dominik-esb

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.

https://github.com/Akascape/CTkToolTip/blob/e9448cb7fc24d83f0d8e2754bb9a9b76ebb4594b/CTkToolTip/ctk_tooltip.py#L50

samuelzamvil avatar Apr 17 '24 01:04 samuelzamvil