X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/abbcf16d06a7ac8c627b27e20b55fa915871be37..cf2918d40e990646a1277ba67a029cafe9e0fec8:/samples/thread/thread.cpp diff --git a/samples/thread/thread.cpp b/samples/thread/thread.cpp index 078442a786..ad2ca59220 100644 --- a/samples/thread/thread.cpp +++ b/samples/thread/thread.cpp @@ -305,14 +305,14 @@ void *MyWorkerThread::Entry() event.SetInt( m_count ); // send in a thread-safe way - wxPostEvent( m_frame, event ); + wxQueueEvent( m_frame, new wxCommandEvent(event) ); wxMilliSleep(200); } wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, WORKER_EVENT ); event.SetInt(-1); // that's all - wxPostEvent( m_frame, event ); + wxQueueEvent( m_frame, new wxCommandEvent(event) ); return NULL; } @@ -416,7 +416,7 @@ bool MyApp::OnInit() menuBar->Append(menuHelp, _T("&Help")); frame->SetMenuBar(menuBar); - + // Show the frame frame->Show(true); @@ -431,7 +431,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)) { SetIcon(wxIcon(sample_xpm)); - + m_nRunning = m_nCount = 0; m_dlgProgress = (wxProgressDialog *)NULL;