X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e90c1d2a19361551eb07778280f22be3e759cf64..2f073eb2e0786fa44dd41d31eb34d00a75ab0570:/include/wx/app.h diff --git a/include/wx/app.h b/include/wx/app.h index ea63c80601..bbec49fe08 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -232,6 +232,9 @@ public: static wxAppInitializerFunction GetInitializerFunction() { return m_appInitFn; } + // process all events in the wxPendingEvents list + virtual void ProcessPendingEvents(); + // access to the command line arguments int argc; wxChar **argv; @@ -307,6 +310,15 @@ extern void WXDLLEXPORT wxExit(); // Yield to other apps/messages extern bool WXDLLEXPORT wxYield(); +// Post a message to the given eventhandler which will be processed during the +// next event loop iteration +inline void WXDLLEXPORT wxPostEvent(wxEvtHandler *dest, wxEvent& event) +{ + wxCHECK_RET( dest, wxT("need an object to post event to in wxPostEvent") ); + + dest->AddPendingEvent(event); +} + #endif // wxUSE_GUI // console applications may avoid using DECLARE_APP and IMPLEMENT_APP macros