+#if 0
+ WriteText( "Got message from worker thread: " );
+ WriteText( event.GetString() );
+ WriteText( "\n" );
+#else
+ int n = event.GetInt();
+ if ( n == -1 )
+ {
+ m_dlgProgress->Destroy();
+ m_dlgProgress = (wxProgressDialog *)NULL;
+
+ // the dialog is aborted because the event came from another thread, so
+ // we may need to wake up the main event loop for the dialog to be
+ // really closed
+ wxWakeUpIdle();
+ }
+ else
+ {
+ if ( !m_dlgProgress->Update(n) )
+ {
+ wxCriticalSectionLocker lock(m_critsectWork);
+
+ m_cancelled = TRUE;
+ }
+ }
+#endif