diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index b090afb31b..722f5f4bdf 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -260,9 +260,11 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h) SetMenuBar(menu_bar); #endif // wxUSE_MENUS + m_panel = new wxPanel(this); + #if wxUSE_LOG // create the controls - m_textCtrl = new wxTextCtrl(this, wxID_ANY, wxT(""), + m_textCtrl = new wxTextCtrl(m_panel, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxSUNKEN_BORDER); #endif // wxUSE_LOG @@ -321,7 +323,7 @@ void MyFrame::CreateTreeWithDefStyle() void MyFrame::CreateTree(long style) { - m_treeCtrl = new MyTreeCtrl(this, TreeTest_Ctrl, + m_treeCtrl = new MyTreeCtrl(m_panel, TreeTest_Ctrl, wxDefaultPosition, wxDefaultSize, style); Resize(); diff --git a/samples/treectrl/treetest.h b/samples/treectrl/treetest.h index 21e93d7d8b..1b8f1bc7cd 100644 --- a/samples/treectrl/treetest.h +++ b/samples/treectrl/treetest.h @@ -229,6 +229,7 @@ private: void CreateTreeWithDefStyle(); void CreateTree(long style); + wxPanel *m_panel; MyTreeCtrl *m_treeCtrl; #if wxUSE_LOG wxTextCtrl *m_textCtrl;