简体   繁体   English

在 Tkinter 窗口 Mac OSX 中单击退出时 Python 3.6 崩溃

[英]Python 3.6 crashes when clicking exit in Tkinter window Mac OSX

When trying to close my tkinter window using the red 'x' button (top left) the window doesn't close and python crashes(colour wheel).当尝试使用红色“x”按钮(左上角)关闭我的tkinter窗口时,窗口不会关闭并且 python 崩溃(色轮)。
(note this is across all of my Tkinter apps, not just the one shown) (请注意,这是我所有的 Tkinter 应用程序,而不仅仅是显示的那个)

Here is an image of my code:这是我的代码的图像:

代码图像

Here is the crashed white box, neither "quit" or red "x" works.这是崩溃的白框,“退出”或红色“x”都不起作用。 It doesn't show up in the screenshot but the spinning colour wheel is visible whenever I hover over my window.它没有出现在屏幕截图中,但每当我将鼠标悬停在窗口上时,旋转的色轮都是可见的。 I have to force quit due to "Python not responding".由于“Python 没有响应”,我不得不强制退出。

窗口图像

Got me thinking when I run python in the shell there's an error message: TK Tcl .当我在 shell 中运行 python 时,我想到了一条错误消息: TK Tcl Maybe unstable.也许不稳定。

I suggest to try master.destroy instead of frame.quit for the callback of the Quit button, and give us feedback whether it changes anything我建议尝试使用master.destroy而不是frame.quit作为退出按钮的回调,并向我们反馈它是否改变了什么

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM