From 488b2c29c0cf468f96f148003b21952611325dbf Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 29 Mar 2005 13:09:31 +0000 Subject: [PATCH] destroying native and wx controls git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/toolbar.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/mac/carbon/toolbar.cpp b/src/mac/carbon/toolbar.cpp index 718123647d..5f03590f8f 100644 --- a/src/mac/carbon/toolbar.cpp +++ b/src/mac/carbon/toolbar.cpp @@ -665,6 +665,23 @@ bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool) tool->Detach(); + wxToolBarTool* tl = wx_static_cast( wxToolBarTool* , tool ) ; + switch ( tool->GetStyle() ) + { + case wxTOOL_STYLE_CONTROL: + tool->GetControl()->Destroy(); + break; + + case wxTOOL_STYLE_BUTTON: + case wxTOOL_STYLE_SEPARATOR: + if ( tl->GetControlHandle() ) + { + DisposeControl( (ControlRef) tl->GetControlHandle() ) ; + tl->SetControlHandle( (ControlRef) NULL ) ; + } + break; + } + // and finally reposition all the controls after this one for ( /* node -> first after deleted */ ; node; node = node->GetNext() ) -- 2.47.2