当我运行此代码时,文件选择器出现,然后当我完成它时,我无法输入条目小部件,直到我专注于另一个窗口然后回来.为什么会这样?
import tkinter as tk
from tkinter.filedialog import askopenfilename
location = ''
start = tk.Tk()
tk.Label(text='What is the name of your table?').pack()
box = tk.Entry(start, exportselection=0, state=tk.DISABLED)
box.pack()
button = tk.Button(start, text='OK', command=lambda e: None)
button.pack()
location = askopenfilename(defaultextension='.db',
title="Choose your database",
filetypes=[('Database Files', '.db'), ('All files', '*')])
box.config(state=tk.NORMAL)
start.mainloop()