First time here? Check out the FAQ!
1

TK messagebox hanging after update to Wing 11

  • retag add tags

I just updated to Wing 11.0.3, and code that was working in Wing 10 is hanging:

import tkinter as tk
from tkinter import messagebox
...
        root = tk.Tk()
        root.withdraw() # Hide the main root window

        result = messagebox.askyesno("title", "question", parent=root)

Any thoughts as to what might be wrong?

UPDATE: Since I just tried the code above independently, and it executes without a problem in Wing 11, I probably need to give more context.

This code is being run during the "import" of the module, not in the if __name__ == "__main__": section of the code (which is just used for testing). This code is a module used by SIL Converters to do script conversion. So when the module is loaded, we want to ask the user a question about how to carry out the conversion, script conversion data is loaded, and then whenever the Convert() function is called, it performs the script conversion on the data passed. In that case, the "__main__" section of the code is never run.

So does Wing 11 handle the "import" of the module differently in some way? I could send my code to the Wing developers for testing if that would help, but don't really want to post it publicly here.

Thanks, Jeff

UPDATE #2: And just to confirm, I ran the script with Wing 10 (which fortunately I hadn't uninstalled yet!), and it worked fine. The same script in Wing 11 hangs on the messagebox command.

JeffH's avatar
61
JeffH
asked 2025-08-04 08:40:48 +0000, updated 2025-08-04 09:13:28 +0000
edit flag offensive 0 remove flag close merge delete

Comments

Please send your code or a test case that reproduces this to support@wingware.com It will hopefully help us narrow down where the problem could be.

Wingware Support's avatar Wingware Support (2025-08-04 10:36:49 +0000) edit
add a comment see more comments

1 Answer

0

I suspect based on other more recent reports that the Tk window was coming up behind the IDE window, particularly if on macOS. If true, this may help:

import tkinter as tk
from tkinter import messagebox

# Set up Tk top-level to defeat macOS window order issues when debugging
import sys
if hasattr(sys, '_wing_debugger'):
  _root = tk.Tk()
  _root.withdraw()
  sw = _root.winfo_screenwidth()
  sh = _root.winfo_screenheight()
  _root.geometry(f'1x1+{sw // 2}+{sh // 3}')
  _root.deiconify()

print(messagebox.askyesno('title', 'question'))
Wingware Support's avatar
4.3k
Wingware Support
answered 2026-03-16 18:38:15 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer

To post on behalf of someone else, enter user name and email below.