[New-bugs-announce] [issue34253] Tkinter- On windows, calling filedialog or messagebox before the window is drawn causes focus issues

Novel report at bugs.python.org
Fri Jul 27 19:28:13 EDT 2018


New submission from Novel <novel.yet.trivial at gmail.com>:

Code to reproduce the problem: 

```
import tkinter as tk
from tkinter.messagebox import showinfo

root = tk.Tk()
entry = tk.Entry(root)
entry.pack()
# root.update() # remove comment to fix the problem
showinfo('alert', 'this parrot is dead!')
root.mainloop()
```

Running this code will show the alert, and when the user clicks "ok" the entry widget acts as if it's disabled and won't focus. Minimizing and restoring the tkinter window brings the entry widget back to normal operation. 

Workaround: Calling `update()` before the messagebox or filedialog call gives normal behaviour. 

This issue only affects Windows as far as I can tell.

----------
components: Tkinter
messages: 322516
nosy: nyt
priority: normal
severity: normal
status: open
title: Tkinter- On windows, calling filedialog or messagebox before the window is drawn causes focus issues
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34253>
_______________________________________


More information about the New-bugs-announce mailing list