Skip to content

Added (un)block_update_dimensions_event handling function.#37

Open
kabyru wants to merge 1 commit intoAkascape:mainfrom
kabyru:main
Open

Added (un)block_update_dimensions_event handling function.#37
kabyru wants to merge 1 commit intoAkascape:mainfrom
kabyru:main

Conversation

@kabyru
Copy link
Copy Markdown
Contributor

@kabyru kabyru commented Mar 30, 2026

Hello, I would like to contribute a code update to handle Tkinter resolution scaling events that are sent to this widget. When a GUI widget is ran in a desktop environment that has a scaled resolution (say you're using a laptop with a 4K display but it is scaled 150% via Windows resolution settings), Tkinter will handle scale-up events for widgets by sending a block_update_dimensions_event. This event is handled at the CTk level, but needs to be addressed at this widget level to prevent the widget from breaking due to this event being unhandled.

When unhandled, the CTkToolTip widget can enter into a state that where the alpha-transparency of the widget is broken, leaving tooltips very transparent regardless of the alpha setting set for the widget. By handling these events, we can ensure that this adverse behavior does not happen. So, I am proposing we add code to CTkToolTip that handles these events by simply returning True, which will preserve existing tooltip behavior and ensure the alpha-transparency of widgets does not break on scaled-up resolution displays.

Attached are pictures showing examples of broken behavior caused by not handling this event:

Example traceback from event being unhandled:
image

Example impact to CTkToolTip widget when event is unhandled:
button_scaling_impact

Example of widget functioning with new code, when the window rides between a scaled display and an unscaled display (this situation will always trigger the event in question):
Screenshot 2026-03-30 113724

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant