replace wxPostEvent with wxQueueEvent and update the thread sample description (the sample doesn't shows usage of wxMutexGuiEnter/Leave)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2008-12-20 21:29:20 +00:00
parent c6427d4da4
commit d1935bf638
2 changed files with 13 additions and 14 deletions

View File

@@ -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;