]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/thread/thread.cpp
Added taskbar sample Makefile.in
[wxWidgets.git] / samples / thread / thread.cpp
index ad6b45438efd791382526b91cc75c280351a628d..b176ef8c01b2e339b5198734770b888f0350a1ac 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "wx/progdlg.h"
 
+#define USE_EXECUTE
 #ifdef USE_EXECUTE
     #define EXEC(cmd) wxExecute((cmd), wxEXEC_SYNC)
 #else
@@ -562,10 +563,10 @@ void MyFrame::OnIdle(wxIdleEvent &event)
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
 {
-    size_t count = wxGetApp().m_threads.Count();
-    for ( size_t i = 0; i < count; i++ )
+    const wxArrayThread& threads = wxGetApp().m_threads;
+    while ( !threads.IsEmpty() )
     {
-        wxGetApp().m_threads[0]->Delete();
+        threads[0]->Delete();
     }
 
     Close(TRUE);
@@ -573,16 +574,16 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
 
 void MyFrame::OnExecMain(wxCommandEvent& WXUNUSED(event))
 {
-    wxLogMessage("The exit code from the main program is %ld",
+    wxLogMessage(wxT("The exit code from the main program is %ld"),
                  EXEC("/bin/echo \"main program\""));
 }
 
 void MyFrame::OnExecThread(wxCommandEvent& WXUNUSED(event))
 {
-    MyExecThread thread("/bin/echo \"child thread\"");
+    MyExecThread thread(wxT("/bin/echo \"child thread\""));
     thread.Run();
 
-    wxLogMessage("The exit code from a child thread is %ld",
+    wxLogMessage(wxT("The exit code from a child thread is %ld"),
                  (long)thread.Wait());
 }
 
@@ -606,7 +607,7 @@ void MyFrame::OnShowCPUs(wxCommandEvent& WXUNUSED(event))
             break;
 
         default:
-            msg.Printf("This system has %d CPUs", nCPUs);
+            msg.Printf(wxT("This system has %d CPUs"), nCPUs);
     }
             
     wxLogMessage(msg);