Don't try setting width before column is added to wxOSX wxDVC.

This is not going to work anyhow and the width will be really set later, when
InsertColumn() is called.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78297 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-12-22 01:31:26 +00:00
parent fb5c63beb7
commit 3db29244e5

View File

@@ -3299,16 +3299,20 @@ void wxDataViewColumn::SetWidth(int width)
{
m_width = width;
if ( !GetOwner() )
{
// can't set the real width yet
return;
}
switch ( width )
{
case wxCOL_WIDTH_AUTOSIZE:
if ( GetOwner() )
{
wxCocoaDataViewControl *peer = static_cast<wxCocoaDataViewControl*>(GetOwner()->GetPeer());
peer->FitColumnWidthToContent(GetOwner()->GetColumnPosition(this));
break;
}
// fall through if not yet settable
case wxCOL_WIDTH_DEFAULT:
width = wxDVC_DEFAULT_WIDTH;