]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/thread/test.cpp
minValue and maxValue are interpreted correctly in SetRange() (were inversed)
[wxWidgets.git] / samples / thread / test.cpp
index 3d7e70edc7549c25b40d9cf011099d59232cdb76..279a3d98b1bfc2113d67e7c0731c36e9cb5012f5 100644 (file)
@@ -35,6 +35,8 @@ class MyApp: public wxApp
     bool OnInit(void);
 };
 
+wxMutex text_mutex;
+
 WX_DEFINE_ARRAY(wxThread *,wxArrayThread);
 
 // Define a new frame type
@@ -83,7 +85,9 @@ void *MyThread::Entry()
 
   while (1) {
     TestDestroy();
+    text_mutex.Lock();
     m_frame->m_txtctrl->WriteText(text);
+    text_mutex.Unlock();
     wxSleep(1);
   }
   
@@ -113,15 +117,7 @@ IMPLEMENT_APP      (MyApp)
 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;
@@ -182,7 +178,7 @@ void MyFrame::OnPauseThread(wxCommandEvent& WXUNUSED(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);