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

AttributeError: CTkToolTip object has no attribute 'block_update_dimensions_event' #20

Open LaserLisa opened 7 months ago

LaserLisa commented 7 months ago

I have an reproducable error occuring when moving my ctk window on another screen with a different resolution. This happens as soon as I hover over the widget with the tooltip (when the app has moved to the 2nd screen). image I can reproduce it with the example code given in the README. It seems that tkinter has an automatic update dimensions event if the resolution of the screen is changing which is not defined for the ToolTip I started the App on 1920x 1080 screen and moved it to 2560 x 1440.

I am using Windows 11 and CTkToolTip v0.8

Phystek commented 6 months ago

I have this issue too. When i move my window to another monitor, one with a different resolution, the tooltips stop working properly and gives the error shown by LaserLisa -AttributeError: 'CTkToolTip' object has no attribute 'block_update_dimensions_event' This also then interferes with the canvas resizing when I go back to the original screen. Is there any fix/workaround for this?

PabloRiveroFOSSA commented 5 months ago

if you just want to fixt it, even if its not a good fix. Adding this code to the class CTkToolTip will work:

def block_update_dimensions_event(self) -> True:
        return True

def unblock_update_dimensions_event(self) -> True:
        return True
Phystek commented 5 months ago

A further comment on this. In my case, I've found that it is only triggered when one display has scaling set (e.g. 150% in Windows display settings - Scale) and the other doesn't (e.g. just a 100% in Windows display settings - Scale). Do perhaps not an issue with two displays being of different resolution, but rather with different scale settings in Windows.

PabloRiveroFOSSA commented 5 months ago

Yeah I'm pretty sure that's the case, I had quite a lot of issues with CTK when dealing with several screen at different scalings. I ended up dity fixing it by dividing the screen size by the screen scaling depending on the screen the program appears on. And I'm pretty sure this comes from the same root problem