From 9c1d6ef42efd46a7ed418446c35c3b709378cdf0 Mon Sep 17 00:00:00 2001 From: Benjamin Williams Date: Tue, 7 Nov 2006 09:31:42 +0000 Subject: [PATCH] added image to root item of tree in aui sample git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/aui/auidemo.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/samples/aui/auidemo.cpp b/samples/aui/auidemo.cpp index 00986a204b..5f4f7c3ca0 100644 --- a/samples/aui/auidemo.cpp +++ b/samples/aui/auidemo.cpp @@ -1384,16 +1384,17 @@ wxTreeCtrl* MyFrame::CreateTreeCtrl() wxTreeCtrl* tree = new wxTreeCtrl(this, wxID_ANY, wxPoint(0,0), wxSize(160,250), wxTR_DEFAULT_STYLE | wxNO_BORDER); - - wxTreeItemId root = tree->AddRoot(wxT("wxAUI Project")); - wxArrayTreeItemIds items; - - + wxImageList* imglist = new wxImageList(16, 16, true, 2); imglist->Add(wxArtProvider::GetBitmap(wxART_FOLDER, wxART_OTHER, wxSize(16,16))); imglist->Add(wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16))); tree->AssignImageList(imglist); + wxTreeItemId root = tree->AddRoot(wxT("wxAUI Project"), 0); + wxArrayTreeItemIds items; + + + items.Add(tree->AppendItem(root, wxT("Item 1"), 0)); items.Add(tree->AppendItem(root, wxT("Item 2"), 0)); items.Add(tree->AppendItem(root, wxT("Item 3"), 0));