bool OnInit(void);
};
+wxMutex text_mutex;
+
WX_DEFINE_ARRAY(wxThread *,wxArrayThread);
// Define a new frame type
while (1) {
TestDestroy();
+ text_mutex.Lock();
m_frame->m_txtctrl->WriteText(text);
+ text_mutex.Unlock();
wxSleep(1);
}
bool MyApp::OnInit(void)
{
// Create the main frame window
- MyFrame *frame = new MyFrame(NULL, "Minimal wxWindows App", 50, 50, 450, 340);
-
- // Give it an icon
-#ifdef __WXMSW__
- frame->SetIcon(wxIcon("AIAI"));
-#endif
-#ifdef __X__
- frame->SetIcon(wxIcon("aiai.xbm"));
-#endif
+ MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "Minimal wxWindows App", 50, 50, 450, 340);
// Make a menubar
wxMenu *file_menu = new wxMenu;
wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))
{}
-void MyFrame::OnStartThread(wxCommandEvent& event)
+void MyFrame::OnStartThread(wxCommandEvent& WXUNUSED(event) )
{
MyThread *thread = new MyThread(this);
m_threads.Add(thread);
}
-void MyFrame::OnStopThread(wxCommandEvent& event)
+void MyFrame::OnStopThread(wxCommandEvent& WXUNUSED(event) )
{
- uint no_thrd = m_threads.Count()-1;
+ int no_thrd = m_threads.Count()-1;
if (no_thrd < 0)
return;
m_threads.Remove(no_thrd);
}
-void MyFrame::OnPauseThread(wxCommandEvent& event)
+void MyFrame::OnPauseThread(wxCommandEvent& WXUNUSED(event) )
{}
-void MyFrame::OnQuit(wxCommandEvent& event)
+void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
{
- uint i;
+ unsigned int i;
for (i=0;i<m_threads.Count();i++)
delete (m_threads[i]);
Close(TRUE);
}
-void MyFrame::OnAbout(wxCommandEvent& event)
+void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
{
wxMessageDialog dialog(this, "wxThread sample (based on minimal)\nJulian Smart and Guilhem Lavaux",
"About wxThread sample", wxYES_NO|wxCANCEL);