diff --git a/docs/doxygen/overviews/xrc_format.h b/docs/doxygen/overviews/xrc_format.h index c01cae2896..bf9d0d7417 100644 --- a/docs/doxygen/overviews/xrc_format.h +++ b/docs/doxygen/overviews/xrc_format.h @@ -1379,7 +1379,7 @@ following properties (all of them optional): @row3col{text, @ref overview_xrcformat_type_text, The title of the column. } @row3col{width, integer, - The column width. } + The column width. @c wxLIST_DEFAULT_COL_WIDTH is used by default. } @row3col{image, integer, The zero-based index of the image associated with the item in the 'small' image list. } @endTable diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index cb28fba2a4..81fe66ca8a 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -313,8 +313,9 @@ void wxListHeaderData::SetItem( const wxListItem &item ) if ( m_mask & wxLIST_MASK_FORMAT ) m_format = item.m_format; - if ( m_mask & wxLIST_MASK_WIDTH ) - SetWidth(item.m_width); + // Always give some initial width to the new columns (it's still possible + // to set the width to 0 explicitly, however). + SetWidth(m_mask & wxLIST_MASK_WIDTH ? item.m_width : wxLIST_DEFAULT_COL_WIDTH); if ( m_mask & wxLIST_MASK_STATE ) SetState(item.m_state);