[issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04

John McCabe report at bugs.python.org
Sun Jan 10 16:14:18 EST 2021


John McCabe <john at 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 <report at bugs.python.org>
<https://bugs.python.org/issue42867>
_______________________________________


More information about the Python-bugs-list mailing list