Skip to content

Conversation

@Wulian233
Copy link
Contributor

@Wulian233 Wulian233 commented Jun 1, 2024

Refer #119459 , we believe this is a tk/tkinter bug that should be fixed in tkinter. In this PR, I added the fix code to tkinter/__init__.py, which fixes the window blurring problem that every program that uses tkinter has. Since I had already committed fix for turtledemo and terryjreedy fix IDLE earlier, I removed them here. Also #119175 was backported to 3.12 3.13 and I think this PR should be as well.

↓Fix
fix

# CALL BEFORE ANY TK OPERATIONS!
# URL for arguments for the ...Awareness call below.
# https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx
if sys.platform == 'win32':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my humble opinion, can you guarantee that this code will not be called repeatedly? Maybe it only needs to be called once?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a print statement to your code and just try the code below:

from tkinter import messagebox

messagebox.showinfo("info", "test")
messagebox.showinfo("info", "test")

Then you'll find that it runs twice.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants