程序“ python”收到X Window系统错误

Sag*_*usA 5 python user-interface

我一直在为一个小程序创建GUI界面,以将书存储在数据库中。通常,一切正常,但是当我单击“添加按钮”时,在执行动作之后,程序将关闭并且可以在终端上阅读:

The program 'python' received an X Window System error.

This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 4916 error_code 3 request_code 15 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
Run Code Online (Sandbox Code Playgroud)

我真的不明白这是什么错误。我正确地使用Tkinter库创建GUI(窗口,按钮,表单,表格...)感谢所有