I try to use wxApp with wxDialog. At wxApp's OnInti, a wxDialog derived
object creared, show and also SetTopWindow(the dialog ptr).
the app is invoked via command line, the dialog popped up but when
the dialog is closed, the app doesn't exit. if I put a wxFrme derived
object instead, after I close the popped up the frame object window,
the app does exit.
could some one tell me how ?
regards
ming
Dialogs don't get destroyed automatically on close.
See: http://www.wxwidgets.org/technote/dlgbased.htm
There's a paragraph entitled: "Closing the application".
In short: you should call Destroy() instead of Close(), when you want to
quit.
I haven't tried it myself :)
--
Marcin Simonides
"Xu, Ming (NIH/NLM/NCBI) [F]" wrote in message ...
>Hi,
>I try to use wxApp with wxDialog. At wxApp's OnInti, a wxDialog derived
>object creared, show and also SetTopWindow(the dialog ptr).
>could some one tell me how ?
bool MyApp::OnInit(){
BwxTimeDlg BTDlg(0, "BwxTimeDlg BTDlg");
BTDlg.ShowModal();
return false; // <----- note the 'false' here.
} //MyApp::OnInit()
If you return 'true' from 'OnInit()', it signals the program to keep running.
--
Bob R
POVrookie
return TRUE at MyApp::OnInit(){... return TRUE }
for wxFrame derived object is OK, but wxDialog derived
object must return FALSE. I thoguht they are both derived
from wxWindow so should work the same way, when the derived
wxWindow object exits, how is wxApp::OnExit called ? it seems
wxFrame calls wxApp::OnExit in some way but wxDialog doesn't.
regards
ming
--
Bob R
POVrookie
---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-u...@lists.wxwidgets.org
For additional commands, e-mail: wx-use...@lists.wxwidgets.org