#include "wx/msgout.h"
#include "wx/thread.h"
#include "wx/vidmode.h"
+#include "wx/evtloop.h"
#ifdef __WXDEBUG__
#if wxUSE_STACKWALKER
wxAppBase::wxAppBase()
{
- m_topWindow = (wxWindow *)NULL;
+ m_topWindow = NULL;
m_useBestVisual = false;
m_forceTrueColour = false;
m_isActive = true;
- m_isInsideYield = false;
-
// We don't want to exit the app if the user code shows a dialog from its
// OnInit() -- but this is what would happen if we set m_exitOnFrameDelete
// to Yes initially as this dialog would be the last top level window.
wxBitmap::InitStandardHandlers();
+ // for compatibility call the old initialization function too
+ if ( !OnInitGui() )
+ return false;
+
return true;
}
(void)ProcessEvent(event);
}
+bool wxAppBase::SafeYield(wxWindow *win, bool onlyIfNeeded)
+{
+ wxWindowDisabler wd(win);
+
+ wxEventLoopBase * const loop = wxEventLoopBase::GetActive();
+
+ return loop && loop->Yield(onlyIfNeeded);
+}
+
+bool wxAppBase::SafeYieldFor(wxWindow *win, long eventsToProcess)
+{
+ wxWindowDisabler wd(win);
+
+ wxEventLoopBase * const loop = wxEventLoopBase::GetActive();
+
+ return loop && loop->YieldFor(eventsToProcess);
+}
+
+
// ----------------------------------------------------------------------------
// idle handling
// ----------------------------------------------------------------------------