]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datavcmn.cpp
rename wxHeaderCtrl DRAG events into RESIZE ones as we're also going to have column...
[wxWidgets.git] / src / common / datavcmn.cpp
index 26d568cd34ebbe0b1081ebb583ac27568ab18bae..34e2123b6c3ac89411baf6c2c50c3b341d0ddaa2 100644 (file)
@@ -1887,10 +1887,12 @@ void wxDataViewTreeCtrl::OnCollapsed( wxDataViewEvent &event )
 void wxDataViewTreeCtrl::OnSize( wxSizeEvent &event )
 {
 #if defined(wxUSE_GENERICDATAVIEWCTRL)
-    wxSize size = GetClientSize();
-    wxDataViewColumn *col = GetColumn( 0 );
-    if (col)
-       col->SetWidth( size.x );
+    // automatically resize our only column to take the entire control width
+    if ( GetColumnCount() )
+    {
+        wxSize size = GetClientSize();
+        GetColumn(0)->SetWidth(size.x);
+    }
 #endif
     event.Skip( true );
 }