From 52b79074cea095c21bf4903231b2aaf782c02ce2 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Tue, 19 Nov 2002 21:56:10 +0000 Subject: [PATCH] Actually destroy the toolbar tool controls when destryoing the toolbar as we otherwise leave ghosts around. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17917 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/toolbar.cpp | 7 +++++++ src/mac/toolbar.cpp | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/mac/carbon/toolbar.cpp b/src/mac/carbon/toolbar.cpp index 0ed2cc6b55..c1d36f4122 100644 --- a/src/mac/carbon/toolbar.cpp +++ b/src/mac/carbon/toolbar.cpp @@ -159,6 +159,13 @@ bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons wxToolBar::~wxToolBar() { + size_t index = 0 ; + for ( index = 0 ; index < m_macToolHandles.Count() ; ++index ) + { + // Delete the control as we get ghosts otherwise + ::DisposeControl( (ControlHandle) m_macToolHandles[index] ); + } + // we must refresh the frame size when the toolbar is deleted but the frame // is not - otherwise toolbar leaves a hole in the place it used to occupy } diff --git a/src/mac/toolbar.cpp b/src/mac/toolbar.cpp index 0ed2cc6b55..c1d36f4122 100644 --- a/src/mac/toolbar.cpp +++ b/src/mac/toolbar.cpp @@ -159,6 +159,13 @@ bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons wxToolBar::~wxToolBar() { + size_t index = 0 ; + for ( index = 0 ; index < m_macToolHandles.Count() ; ++index ) + { + // Delete the control as we get ghosts otherwise + ::DisposeControl( (ControlHandle) m_macToolHandles[index] ); + } + // we must refresh the frame size when the toolbar is deleted but the frame // is not - otherwise toolbar leaves a hole in the place it used to occupy }