Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LaserLisa opened this issue Feb 9, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@LaserLisa
Copy link

LaserLisa commented Feb 9, 2024

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
Copy link

Phystek commented Mar 8, 2024

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?

@Akascape Akascape added the bug Something isn't working label Mar 8, 2024
@PabloRiveroFOSSA
Copy link

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
Copy link

Phystek commented Apr 3, 2024

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants