+bool MyApp::OnInit()
+{
+ // Create the main frame window
+ MyFrame *frame = new MyFrame((wxFrame *)NULL, "wxWindows threads sample",
+ 50, 50, 450, 340);
+
+ // Make a menubar
+ wxMenu *file_menu = new wxMenu;
+
+ file_menu->Append(TEST_CLEAR, "&Clear log");
+ file_menu->AppendSeparator();
+ file_menu->Append(TEST_ABOUT, "&About");
+ file_menu->AppendSeparator();
+ file_menu->Append(TEST_QUIT, "E&xit");
+ wxMenuBar *menu_bar = new wxMenuBar;
+ menu_bar->Append(file_menu, "&File");
+
+ wxMenu *thread_menu = new wxMenu;
+ thread_menu->Append(TEST_START_THREAD, "&Start a new thread");
+ thread_menu->Append(TEST_START_THREADS, "Start &many threads at once");
+ thread_menu->Append(TEST_STOP_THREAD, "S&top a running thread");
+ thread_menu->AppendSeparator();
+ thread_menu->Append(TEST_PAUSE_THREAD, "&Pause a running thread");
+ thread_menu->Append(TEST_RESUME_THREAD, "&Resume suspended thread");
+ menu_bar->Append(thread_menu, "&Thread");
+ frame->SetMenuBar(menu_bar);
+
+ // Show the frame
+ frame->Show(TRUE);
+
+ SetTopWindow(frame);
+
+ return TRUE;
+}
+
+// My frame constructor
+MyFrame::MyFrame(wxFrame *frame, const wxString& title,
+ int x, int y, int w, int h)
+ : wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))