git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57189
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
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 );
}