]> git.saurik.com Git - wxWidgets.git/commitdiff
Add column to control after association with model (currently a requirement for wxMac)
authorRobert Roebling <robert@roebling.de>
Tue, 23 Oct 2007 21:11:48 +0000 (21:11 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 23 Oct 2007 21:11:48 +0000 (21:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/dataview/dataview.cpp

index e89052f02d0b92ab368e41965b6906d6f6c65dc9..28b0424db0c47e65e9d2b8b3879156505b4f1945 100644 (file)
@@ -752,20 +752,20 @@ void MyFrame::OnTestTreeCtrl(wxCommandEvent& WXUNUSED(event) )
     
     wxDataViewCtrl *treectrl = new wxDataViewCtrl( &dialog, -1, 
         wxDefaultPosition, wxSize(300,200), wxDV_NO_HEADER );
-    treectrl->AppendIconTextColumn( "no label", 0, wxDATAVIEW_CELL_INERT, 200 );
         
-    main_sizer->Add( treectrl, 1, wxGROW );
-    
     wxDataViewTreeStore *store = new wxDataViewTreeStore;
     wxDataViewItem parent = store->AppendContainer( wxDataViewItem(0), "Root 1", wxIcon(small1_xpm) );
     wxDataViewItem child = store->AppendItem( parent, "Child 1", wxIcon(small1_xpm) );
     child = store->AppendItem( parent, "Child 2", wxIcon(small1_xpm) );
     child = store->AppendItem( parent, "Child 3", wxIcon(small1_xpm) );
-    
     treectrl->AssociateModel( store );
-    
     store->DecRef();
 
+    treectrl->AppendIconTextColumn( "no label", 0, wxDATAVIEW_CELL_INERT, 200 );
+
+    main_sizer->Add( treectrl, 1, wxGROW );
+    
+
     wxSizer *button_sizer = dialog.CreateButtonSizer( wxOK );
     if (button_sizer)
         main_sizer->Add( button_sizer, 0, wxGROW|wxALL, 10 );