John McCabe <j...@mccabe.org.uk> added the comment:

Fair point about being "too" long. Having seen a "short" example that, 
unfortunately, didn't actually exhibit the problem, I thought that providing a 
"smallish" example that definitely did exhibit the issue was quicker than, 
potentially, spending more time than necessary cutting it down.

However, for the record, hope the below example is better. As before, changing:

self.createWidgets()

to:

self.after_idle(self.createWidgets())

avoids the issue.

-----
#!/usr/bin/python3

import tkinter as tk
from tkinter import messagebox

class Application(tk.Frame):

    def __init__(self, master):
        super().__init__(master)
        self.master = master
        self.pack()
        self.createWidgets()

    def createWidgets(self):
        tk.messagebox.askquestion("Use An Existing File", "Do you want to load 
and use an existing file?")
        tk.Entry(self.master, width = 20).pack()

if __name__ == "__main__":
    root = tk.Tk()
    app = Application(root)
    app.mainloop()

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42867>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to