Author Topic: Compiled app can't close (wxSmith)  (Read 5949 times)

Offline glatocha

  • Single posting newcomer
  • *
  • Posts: 3
Compiled app can't close (wxSmith)
« on: March 03, 2014, 04:04:39 am »
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
« Last Edit: March 03, 2014, 05:22:51 am by glatocha »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Compiled app can't close (wxSmith)
« Reply #1 on: March 03, 2014, 07:11:01 am »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline glatocha

  • Single posting newcomer
  • *
  • Posts: 3
Re: Compiled app can't close (wxSmith)
« Reply #2 on: March 03, 2014, 09:28:21 am »
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


Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Compiled app can't close (wxSmith)
« Reply #3 on: March 03, 2014, 10:28:37 am »
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 !

Offline glatocha

  • Single posting newcomer
  • *
  • Posts: 3
Re: Compiled app can't close (wxSmith)
« Reply #4 on: March 03, 2014, 11:33:10 am »
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.