This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jmccabe
Recipients christian.heimes, epaine, jmccabe, serhiy.storchaka, terry.reedy
Date 2021-01-10.21:14:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1610313258.29.0.996658636226.issue42867@roundup.psfhosted.org>
In-reply-to
Content
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()
History
Date User Action Args
2021-01-10 21:14:18jmccabesetrecipients: + jmccabe, terry.reedy, christian.heimes, serhiy.storchaka, epaine
2021-01-10 21:14:18jmccabesetmessageid: <1610313258.29.0.996658636226.issue42867@roundup.psfhosted.org>
2021-01-10 21:14:18jmccabelinkissue42867 messages
2021-01-10 21:14:17jmccabecreate