wxProgressDialog need a running eventloop to work.
I have a wxApp without creating a top-level window. It only do some work automaticly and tell the progress with a progress-window and close after that automaticly.
Using wxProgressDialog inside wxApp::OnInit() doesn't work because while this no eventloop is running.
Using it in wxApp::OnRun() has the same problem.
When I call the default OnRun() the eventloop run but idle and never step back. So my app can not do it's work.
How can I solve that?
wxProgressDialog without mainframe-window but eventloop Topic is solved
Moin!
Try with a wxWidgets 2.9.x release. Quoting the changelog:
"Major new features in this release
----------------------------------
....
- Event loops, timers and sockets can now be used in wxBase, without GUI.
...."
Apparently this would solve your issue.
Try with a wxWidgets 2.9.x release. Quoting the changelog:
"Major new features in this release
----------------------------------
....
- Event loops, timers and sockets can now be used in wxBase, without GUI.
...."
Apparently this would solve your issue.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
wxProgressDialog derives from wxDialog, so it should have it's own event loop. What platform/wx version are you using?
If i put the following code in MyApp::OnInit() of the "minimal" sample, it does work:
If i put the following code in MyApp::OnInit() of the "minimal" sample, it does work:
Code: Select all
{
wxProgressDialog prog(wxT("test"), wxT("test"));
bool ok=true;
for(int i=0; i<100 && ok; i++) {
ok=prog.Update(i);
::wxMilliSleep(25);
}
}
Is it a console application, or a "normal" GUI application, just without a main window? If it's a console application, you must follow upCASEs advice and use 2.9.xUsing wxProgressDialog inside wxApp::OnInit() doesn't work because while this no eventloop is running.
Use the source, Luke!