]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/thread/thread.cpp
Added wxStringBufferLength: works like wxStringBuffer, except
[wxWidgets.git] / samples / thread / thread.cpp
index 25cec9bb13b49b855a811009d9ae333c268a105b..1fc119359c0b8dd1abac5115b14d962b4ab78aad 100644 (file)
@@ -26,7 +26,6 @@
 
 #include "wx/thread.h"
 #include "wx/dynarray.h"
-#include "wx/time.h"
 
 #include "wx/progdlg.h"
 
@@ -223,7 +222,7 @@ void *MyThread::Entry()
 {
     wxString text;
 
-    text.Printf(wxT("Thread 0x%x started (priority = %u).\n"),
+    text.Printf(wxT("Thread 0x%lx started (priority = %u).\n"),
                 GetId(), GetPriority());
     WriteText(text);
     // wxLogMessage(text); -- test wxLog thread safeness
@@ -234,14 +233,14 @@ void *MyThread::Entry()
         if ( TestDestroy() )
             break;
 
-        text.Printf(wxT("[%u] Thread 0x%x here.\n"), m_count, GetId());
+        text.Printf(wxT("[%u] Thread 0x%lx here.\n"), m_count, GetId());
         WriteText(text);
 
         // wxSleep() can't be called from non-GUI thread!
         wxThread::Sleep(1000);
     }
 
-    text.Printf(wxT("Thread 0x%x finished.\n"), GetId());
+    text.Printf(wxT("Thread 0x%lx finished.\n"), GetId());
     WriteText(text);
     // wxLogMessage(text); -- test wxLog thread safeness
 
@@ -580,7 +579,7 @@ void MyFrame::OnPauseThread(wxCommandEvent& WXUNUSED(event) )
 }
 
 // set the frame title indicating the current number of threads
-void MyFrame::OnIdle(wxIdleEvent &event)
+void MyFrame::OnIdle(wxIdleEventevent)
 {
     wxCriticalSectionLocker enter(wxGetApp().m_critsect);
 
@@ -601,6 +600,8 @@ void MyFrame::OnIdle(wxIdleEvent &event)
         wxLogStatus(this, wxT("%u threads total, %u running."), nCount, nRunning);
     }
     //else: avoid flicker - don't print anything
+
+    event.Skip();
 }
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
@@ -686,13 +687,13 @@ void MyFrame::OnShowCPUs(wxCommandEvent& WXUNUSED(event))
         default:
             msg.Printf(wxT("This system has %d CPUs"), nCPUs);
     }
-            
+
     wxLogMessage(msg);
 }
 
 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
 {
-    wxMessageDialog dialog(this, 
+    wxMessageDialog dialog(this,
                            _T("wxWindows multithreaded application sample\n")
                            _T("(c) 1998 Julian Smart, Guilhem Lavaux\n")
                            _T("(c) 1999 Vadim Zeitlin\n")