- c->top.Below (frame->m_treeCtrl);
- c->left.SameAs (frame, wxLeft);
- c->right.SameAs (frame, wxRight);
- c->bottom.SameAs (frame, wxBottom);
- frame->m_logWindow->SetConstraints(c);
- frame->SetAutoLayout(TRUE);
-
- frame->m_treeCtrl->SetImageList(wxGetApp().m_imageListNormal, wxIMAGE_LIST_NORMAL);
-
- long rootId = frame->m_treeCtrl->InsertItem(0, "Root", 0);
-
- char buf[20];
- int i;
- wxString str;
-
- for ( i = 0; i < 10; i++)
- {
- sprintf(buf, "Folder child %d", i);
- str = buf;
- long id = frame->m_treeCtrl->InsertItem(rootId, str, 0);
- int j;
- for ( j = 0; j < 5; j++)
- {
- sprintf(buf, "File child %d", j);
- str = buf;
- frame->m_treeCtrl->InsertItem(id, str, 1);
- }
- }
- for ( i = 0; i < 10; i++)
- {
- sprintf(buf, "File child %d", i);
- str = buf;
- frame->m_treeCtrl->InsertItem(rootId, str, 1);
- }
-
- frame->CreateStatusBar(3);
- frame->SetStatusText("", 0);
-
- // Show the frame
- frame->Show(TRUE);
-
- SetTopWindow(frame);
-
- return TRUE;
+ c->top.Below(m_treeCtrl);
+ c->left.SameAs(this, wxLeft);
+ c->right.SameAs(this, wxRight);
+ c->bottom.SameAs(this, wxBottom);
+ textCtrl->SetConstraints(c);
+ SetAutoLayout(TRUE);
+
+ // create a status bar with 3 panes
+ CreateStatusBar(3);
+ SetStatusText("", 0);
+
+#ifdef __WXMOTIF__
+ // For some reason, we get a memcpy crash in wxLogStream::DoLogStream
+ // on gcc/wxMotif, if we use wxLogTextCtl. Maybe it's just gcc?
+ delete wxLog::SetActiveTarget(new wxLogStderr);
+#else
+ // set our text control as the log target
+ wxLogTextCtrl *logWindow = new wxLogTextCtrl(textCtrl);
+ delete wxLog::SetActiveTarget(logWindow);
+#endif