News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Compiled app can't close (wxSmith)

Started by glatocha, March 03, 2014, 04:04:39 AM

Previous topic - Next topic

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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

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.

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.