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