diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index b6fc60857e..a2031d8b5f 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -138,13 +138,18 @@ public: if ( width == m_width ) return false; + // Normally we don't update it here as this method is called by + // UpdateColumnSizes() which resizes the column automatically, and not + // "manually", but if it's the first time the width is being set for a + // column created with the default width, do set m_manuallySetWidth in + // order to prevent the column from becoming narrower than its initial + // size when the control is resized, as this is unexpected. + if ( m_width == -1 ) + m_manuallySetWidth = width; + m_width = width; UpdateWidth(); - // We must not update m_manuallySetWidth here as this method is called by - // UpdateColumnSizes() which resizes the column automatically, and not - // "manually". - return true; }