+ if ( !m_pendingEvents )
+ m_pendingEvents = new wxList;
+
+ wxEvent *event2 = (wxEvent *)event.Clone();
+
+ m_pendingEvents->Append(event2);
+
+#if defined(__VISAGECPP__)
+ wxLEAVE_CRIT_SECT( m_eventsLocker);
+#else
+ wxLEAVE_CRIT_SECT( *m_eventsLocker);
+#endif
+
+ // 2) Add this event handler to list of event handlers that
+ // have pending events.
+
+ wxENTER_CRIT_SECT(*wxPendingEventsLocker);
+
+ if ( !wxPendingEvents )
+ wxPendingEvents = new wxList;
+ wxPendingEvents->Append(this);
+
+ // 3) Inform the system that new pending events are somwehere,
+ // and that these should be processed in idle time.
+
+ wxWakeUpIdle();
+
+ wxLEAVE_CRIT_SECT(*wxPendingEventsLocker);