Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / Application keeps on running

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Application keeps on running
#4657
Posted by: KaReL 2004-06-28 04:27:40
I have an app where inside App::OnInit I create a wxDialog with no parent. (NULL)...

After it I create a wxFrame and set that as SetTopWindow().


Now when I close both the dialog and the frame, the application keeps on running and never gets into App::OnExit...

If I don't create the wxDialog, everything is fine...
Can anyone explain me why?


Thanks!!

KaReL
------------------------
Website: www.KaReLs0ft.be
Message2. Re: Application keeps on running
#4666
Posted by: upCASE 2004-06-29 02:48:48
Hi!
Dialogs do have their own message loops. Thus creating them with no parent and not calling them as a modal dialog may lead to the destruction of the dialog window, but not the message loop. The dialog still is active in background.
To prevent that call Destroy() for the dialog.
Check this article for dialog based apps:
http://www.wxwidgets.org/technote/dlgbased.htm
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: Application keeps on running
#4668
Posted by: KaReL 2004-06-29 04:10:53
I solved it by:

  ConfigurationWindow * cw = new ConfigurationWindow(NULL);
  wxDELETE(cw);


Works like a charm ;-)
------------------------
Website: www.KaReLs0ft.be
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-3-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0