+ return thread;
+}
+
+void MyFrame::OnStartThreads(wxCommandEvent& WXUNUSED(event) )
+{
+ static wxString s_str;
+ s_str = wxGetTextFromUser("How many threads to start: ",
+ "wxThread sample",
+ s_str, this);
+ if ( s_str.IsEmpty() )
+ return;
+
+ size_t count, n;
+ sscanf(s_str, "%u", &count);
+ if ( count == 0 )
+ return;
+
+ wxArrayThread threads;
+
+ // first create them all...
+ for ( n = 0; n < count; n++ )
+ {
+ threads.Add(CreateThread());
+ }
+
+ wxString msg;
+ msg.Printf("%d new threads created.", count);
+ SetStatusText(msg, 1);
+
+ // ...and then start them
+ for ( n = 0; n < count; n++ )
+ {
+ threads[n]->Run();
+ }
+}
+
+void MyFrame::OnStartThread(wxCommandEvent& WXUNUSED(event) )
+{
+ MyThread *thread = CreateThread();
+