From 164d6a95e6fe71bb193abfc3a47ae95adee8d32d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 19 Sep 2002 11:53:21 +0000 Subject: [PATCH] remove the old buttons in Realize() before inserting the new ones in text only mode too git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17274 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/tbar95.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 8777634b70..9fd39ade69 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -472,6 +472,15 @@ bool wxToolBar::Realize() const bool isVertical = HasFlag(wxTB_VERTICAL); + // delete all old buttons, if any + for ( size_t pos = 0; pos < m_nButtons; pos++ ) + { + if ( !::SendMessage(GetHwnd(), TB_DELETEBUTTON, 0, 0) ) + { + wxLogDebug(wxT("TB_DELETEBUTTON failed")); + } + } + // First, add the bitmap: we use one bitmap for all toolbar buttons // ---------------------------------------------------------------- @@ -612,15 +621,6 @@ bool wxToolBar::Realize() bitmapId = m_nButtons; } - - // Now delete all the buttons - for ( size_t pos = 0; pos < m_nButtons; pos++ ) - { - if ( !::SendMessage(GetHwnd(), TB_DELETEBUTTON, 0, 0) ) - { - wxLogDebug(wxT("TB_DELETEBUTTON failed")); - } - } } if ( addBitmap ) // no old bitmap or we can't replace it