User forums > Using Code::Blocks
Compiled app can't close (wxSmith)
(1/1)
glatocha:
Hi,
my compiled app (both in Release and Debug mode) can't be closed when clicking on the close window red X. When I click nothing is happening. I debugged that the code is going to OnClose routine. But that's all I could find.
When I create new project all is ok.
I am not entirely sure, but I think it is happening when I delete some components from Form in wxSmith editor.
Should I delete something more is the source code?
Compilation is without any problem
Thanks in advance
MortenMacFly:
No version information...
...no exact steps to reproduce...
...no sample code...
Where you able to answer such a question with such less information? I don't think so. So are we. Sorry.
glatocha:
I am sorry, I just thought someone had this issue before.
My code::blocks version is 13.12 rev 9501
wxWidgets 3.0x
Compiled as static link libraries. used wxSmith as a RAD tool.
About the sourcecode: I really cannot recall the operation that I did after which it stopped working. As I wrote before, I think I delete one control TextCtrl, but I tried to redo it in blank project and didn't succeed.
I post the whole project ~17kb here: glatocha.pl/codeblockproblem.zip
Jenna:
Not a C::B issue, but a wrong use of the OnClose event-handler:
--- Quote from: http://docs.wxwidgets.org/3.0.0/classwx_close_event.html ---You should check whether the application is forcing the deletion of the window using wxCloseEvent::CanVeto. If this is false, you must destroy the window using wxWindow::Destroy.
If the return value is true, it is up to you whether you respond by destroying the window.
--- End quote ---
If you overwrite the OnClose handler, it's up to you to destroy the window or not !
glatocha:
Thanks a lot for your answer.
I have no idea when and how I created the OnClose function.
I just deleted it and it works fine now. Again, thanks a lot for your help.
Navigation
[0] Message Index
Go to full version