How to kill a WxPython application when user clicks a frame's close

前端 未结 4 491
情深已故
情深已故 2020-12-09 10:40

The application is supposed to close when I click the close button for the main frame. But the way I implemented it, it quits with a Segmentation fault when I c

4条回答
  •  北海茫月
    2020-12-09 11:04

    Closing all the top level frames in the app should end the application without needing to bind to close or anything else. You can close them yourself with .Close() if you have several, or some that are hidden.

    Also if you have a TaskBarIcon, that will need to be destroyed before the app will end.

    I think your seg fault could be because of another reason, to do with how the frames tear down and destroy their children. I'd try stepping through the code and find out at what point the seg fault is happening.

提交回复
热议问题