\membersection{wxApp::IsMainLoopRunning}\label{wxappismainlooprunning}
-\constfunc{bool}{IsMainLoopRunning}{\void}
+\func{static bool}{IsMainLoopRunning}{\void}
Returns \true if the main event loop is currently running, i.e. if the
application is inside \helpref{OnRun}{wxapponrun}.
// make sure that idle events are sent again
virtual void WakeUpIdle() { }
+ // this is just a convenience: by providing its implementation here we
+ // avoid #ifdefs in the code using it
+ static bool IsMainLoopRunning() { return false; }
+
// debugging support
// -----------------
// return true if we're running main loop, i.e. if the events can
// (already) be dispatched
- bool IsMainLoopRunning() const
+ static bool IsMainLoopRunning()
{
#if wxUSE_EVTLOOP_IN_APP
- return m_mainLoop != NULL;
+ wxAppBase *app = wx_static_cast(wxAppBase *, GetInstance());
+ return app && app->m_mainLoop != NULL;
#else
return false;
#endif
SaveState();
// we may use non blocking sockets only if we can dispatch events from them
- SetFlags( wxIsMainThread() && (wxTheApp && wxTheApp->IsMainLoopRunning())
- ? wxSOCKET_NONE
- : wxSOCKET_BLOCK );
+ SetFlags( wxIsMainThread() && wxApp::IsMainLoopRunning() ? wxSOCKET_NONE
+ : wxSOCKET_BLOCK );
Notify(false);
wxString buf;