don't access inexistent column in wxDataViewTreeCtrl::OnSize() (this bug also probably explains why this code doesn't actually work: size event is generated before we have any columns)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57189 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1887,10 +1887,12 @@ void wxDataViewTreeCtrl::OnCollapsed( wxDataViewEvent &event )
|
|||||||
void wxDataViewTreeCtrl::OnSize( wxSizeEvent &event )
|
void wxDataViewTreeCtrl::OnSize( wxSizeEvent &event )
|
||||||
{
|
{
|
||||||
#if defined(wxUSE_GENERICDATAVIEWCTRL)
|
#if defined(wxUSE_GENERICDATAVIEWCTRL)
|
||||||
|
// automatically resize our only column to take the entire control width
|
||||||
|
if ( GetColumnCount() )
|
||||||
|
{
|
||||||
wxSize size = GetClientSize();
|
wxSize size = GetClientSize();
|
||||||
wxDataViewColumn *col = GetColumn( 0 );
|
GetColumn(0)->SetWidth(size.x);
|
||||||
if (col)
|
}
|
||||||
col->SetWidth( size.x );
|
|
||||||
#endif
|
#endif
|
||||||
event.Skip( true );
|
event.Skip( true );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user