class WXDLLIMPEXP_BASE wxLog;
class WXDLLIMPEXP_BASE wxMessageOutput;
-// wxUSE_EVTLOOP_IN_APP is a temporary hack needed until all ports are updated
-// to use wxEventLoop, otherwise we get linking errors on wxMac, it's going to
-// disappear a.s.a.p.
-#ifdef __WXMAC__
- #define wxUSE_EVTLOOP_IN_APP 0
-#else
- #define wxUSE_EVTLOOP_IN_APP 1
+#if wxUSE_GUI
class WXDLLEXPORT wxEventLoop;
#endif
// crash.
virtual void OnFatalException() { }
-#if wxUSE_EXCEPTIONS
- // function called if an uncaught exception is caught inside the main
- // event loop: it may return true to continue running the event loop or
- // false to stop it (in the latter case it may rethrow the exception as
- // well)
- virtual bool OnExceptionInMainLoop();
-
- // Called when an unhandled C++ exception occurs inside OnRun(): note that
- // the exception type is lost by now, so if you really want to handle the
- // exception you should override OnRun() and put a try/catch around
- // MainLoop() call there
- virtual void OnUnhandledException() { }
-#endif // wxUSE_EXCEPTIONS
-
// Called from wxExit() function, should terminate the application a.s.a.p.
virtual void Exit();
virtual void HandleEvent(wxEvtHandler *handler,
wxEventFunction func,
wxEvent& event) const;
+
+ // Called when an unhandled C++ exception occurs inside OnRun(): note that
+ // the exception type is lost by now, so if you really want to handle the
+ // exception you should override OnRun() and put a try/catch around
+ // MainLoop() call there or use OnExceptionInMainLoop()
+ virtual void OnUnhandledException() { }
#endif // wxUSE_EXCEPTIONS
// process all events in the wxPendingEvents list -- it is necessary to
// (already) be dispatched
static bool IsMainLoopRunning()
{
-#if wxUSE_EVTLOOP_IN_APP
wxAppBase *app = wx_static_cast(wxAppBase *, GetInstance());
return app && app->m_mainLoop != NULL;
-#else
- return false;
-#endif
}
// execute the main GUI loop, the function returns when the loop ends
// Returns true if more idle time is requested.
virtual bool SendIdleEvents(wxWindow* win, wxIdleEvent& event);
- // Perform standard OnIdle behaviour: call from port's OnIdle
- void OnIdle(wxIdleEvent& event);
+
+#if wxUSE_EXCEPTIONS
+ // Function called if an uncaught exception is caught inside the main
+ // event loop: it may return true to continue running the event loop or
+ // false to stop it (in the latter case it may rethrow the exception as
+ // well)
+ virtual bool OnExceptionInMainLoop();
+#endif // wxUSE_EXCEPTIONS
// top level window functions
// returns true if the program is successfully initialized
bool Initialized() { return true; }
+ // perform standard OnIdle behaviour, ensure that this is always called
+ void OnIdle(wxIdleEvent& event);
+
protected:
// delete all objects in wxPendingDelete list
virtual wxAppTraits *CreateTraits();
-#if wxUSE_EVTLOOP_IN_APP
// the main event loop of the application (may be NULL if the loop hasn't
// been started yet or has already terminated)
wxEventLoop *m_mainLoop;
-#endif // wxUSE_EVTLOOP_IN_APP
// the main top level window (may be NULL)
wxWindow *m_topWindow;
#include "wx/motif/app.h"
#elif defined(__WXMGL__)
#include "wx/mgl/app.h"
- #elif defined(__WXGTK__)
+ #elif defined(__WXGTK20__)
#include "wx/gtk/app.h"
+ #elif defined(__WXGTK__)
+ #include "wx/gtk1/app.h"
#elif defined(__WXX11__)
#include "wx/x11/app.h"
#elif defined(__WXMAC__)