Akascape / CTkToolTip

Small pop-up widget for displaying details inside customtkinter. (extension/add-on)
Creative Commons Zero v1.0 Universal
111 stars 7 forks source link

CTkTooltip on CTkCanvas #23

Open PhilipNelson5 opened 4 months ago

PhilipNelson5 commented 4 months ago

I tried to put a CTkTooltip on a CTkCanvas and it failed with this error

File ".venv\Lib\site-packages\CTkToolTip\ctk_tooltip.py", line 42, in __init__
    self.transparent_color = self.widget._apply_appearance_mode(
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'CTkCanvas' object has no attribute '_apply_appearance_mode'

I monkeyed around a little bit and was able to get it working by checking if hasattr(self.widget, _apply_appearance_mode). Is there a reason CTkToolTip can't be attached to a CTkCanvas?

For context, I'm using a small canvas to draw simple status "icons" (just colored circles) and want to use the tooltip to add more information as to why the status is a certain color. There may be a better way to accomplish this too.