SPH
MainLoop.cpp
Go to the documentation of this file.
1 #include "gui/MainLoop.h"
2 #include <wx/app.h>
3 
4 wxDEFINE_EVENT(MAIN_LOOP_TYPE, Sph::MainLoopEvent);
5 
7 
8 void executeOnMainThread(const Function<void()>& function) {
9  MainLoopEvent* evt = new MainLoopEvent(function);
10  wxTheApp->QueueEvent(evt);
11 }
12 
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
NAMESPACE_SPH_BEGIN void executeOnMainThread(const Function< void()> &function)
Posts a callback to be executed on main thread.
Definition: MainLoop.cpp:8
wxDEFINE_EVENT(MAIN_LOOP_TYPE, Sph::MainLoopEvent)
Posting events to be executed on main thread.
#define NAMESPACE_SPH_END
Definition: Object.h:12
Custom event holding a callback.
Definition: MainLoop.h:26