+// ----------------------------------------------------------------------------
+// helper class
+// ----------------------------------------------------------------------------
+
+wxDEFINE_TIED_SCOPED_PTR_TYPE(wxEventLoopImpl);
+
+// this object sets the wxEventLoop given to the ctor as the currently active
+// one and unsets it in its dtor
+class wxEventLoopActivator
+{
+public:
+ wxEventLoopActivator(wxEventLoop **pActive,
+ wxEventLoop *evtLoop)
+ {
+ m_pActive = pActive;
+ m_evtLoopOld = *pActive;
+ *pActive = evtLoop;
+ }
+
+ ~wxEventLoopActivator()
+ {
+ // restore the previously active event loop
+ *m_pActive = m_evtLoopOld;
+ }
+
+private:
+ wxEventLoop *m_evtLoopOld;
+ wxEventLoop **m_pActive;
+};
+