Python Forum
[Tkinter] Window unresponsive when executed. - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/Forum-Python-Coding)
+--- Forum: GUI (https://python-forum.io/Forum-GUI)
+--- Thread: [Tkinter] Window unresponsive when executed. (/Thread-Tkinter-Window-unresponsive-when-executed)



Window unresponsive when executed. - fawazcode - Sep-09-2017

I ran the following code in Spyder with Python3 interpreter in windows7.

import tkinter
import tkinter.simpledialog

root = tkinter.Tk()

name = tkinter.simpledialog.askstring('Name','entername')

After I enter the name in prompt and click OK the tk window get unresponsive. Finally when I close the window after many clicks the Kernel dies and is restarted. Please tell me why this happens and a way to fix it.


RE: Window unresponsive when executed. - nilamo - Sep-10-2017

You should have root.mainloop() in there somewhere, so the gui will listen to os events (like the CloseWindow event).


RE: Window unresponsive when executed. - Larz60+ - Sep-11-2017

there are some examples here: http://nullege.com/codes/search/tkinter.simpledialog