X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b9f246f7d99d2a2bc18d1d074940e5ab7b7bf601..b9efe021b554fa3967d1442cf758435c5cd5ae8f:/src/gtk1/evtloop.cpp?ds=sidebyside diff --git a/src/gtk1/evtloop.cpp b/src/gtk1/evtloop.cpp index 361fa3ab92..ac59d77edb 100644 --- a/src/gtk1/evtloop.cpp +++ b/src/gtk1/evtloop.cpp @@ -6,7 +6,7 @@ // Created: 10.07.01 // RCS-ID: $Id$ // Copyright: (c) 2001 Vadim Zeitlin -// License: wxWindows license +// License: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "evtloop.h" #endif @@ -28,10 +28,8 @@ #pragma hdrstop #endif -#ifndef WX_PRECOMP -#endif //WX_PRECOMP - #include "wx/evtloop.h" +#include "wx/app.h" #include @@ -62,18 +60,13 @@ private: // wxEventLoop running and exiting // ---------------------------------------------------------------------------- -wxEventLoop *wxEventLoop::ms_activeLoop = NULL; +wxEventLoop *wxEventLoopBase::ms_activeLoop = NULL; wxEventLoop::~wxEventLoop() { wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") ); } -bool wxEventLoop::IsRunning() const -{ - return m_impl != NULL; -} - int wxEventLoop::Run() { // event loops are not recursive, you need to create another loop! @@ -110,7 +103,14 @@ void wxEventLoop::Exit(int rc) bool wxEventLoop::Pending() const { - return gtk_events_pending() > 0; + if (wxTheApp) + { + // We need to remove idle callbacks or gtk_events_pending will + // never return false. + wxTheApp->RemoveIdleTag(); + } + + return gtk_events_pending(); } bool wxEventLoop::Dispatch()