#include "wx/progdlg.h"
+#define USE_EXECUTE
#ifdef USE_EXECUTE
#define EXEC(cmd) wxExecute((cmd), wxEXEC_SYNC)
#else
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);
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());
}
break;
default:
- msg.Printf("This system has %d CPUs", nCPUs);
+ msg.Printf(wxT("This system has %d CPUs"), nCPUs);
}
wxLogMessage(msg);