From 570aaadf1ff3f8c3f8ecfea44dbeae64532c82c4 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Sat, 12 Jul 2003 00:52:50 +0000 Subject: [PATCH] In the object destructor, Disassociate the object from its Cocoa counterpart but leave m_cocoaNSView intact so base class destructors can use it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21908 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/cocoa/bmpbuttn.mm | 3 +-- src/cocoa/button.mm | 3 +-- src/cocoa/checkbox.mm | 3 +-- src/cocoa/control.mm | 3 +-- src/cocoa/radiobut.mm | 3 +-- src/cocoa/statbox.mm | 3 +-- src/cocoa/stattext.mm | 3 +-- src/cocoa/textctrl.mm | 3 +-- 8 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/cocoa/bmpbuttn.mm b/src/cocoa/bmpbuttn.mm index 94b40d9160..9245d118c0 100644 --- a/src/cocoa/bmpbuttn.mm +++ b/src/cocoa/bmpbuttn.mm @@ -52,8 +52,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID winid, wxBitmapButton::~wxBitmapButton() { - CocoaRemoveFromParent(); - SetNSButton(NULL); + DisassociateNSButton(m_cocoaNSView); } void wxBitmapButton::Cocoa_wxNSButtonAction(void) diff --git a/src/cocoa/button.mm b/src/cocoa/button.mm index aa8472a8d7..46a2201e0e 100644 --- a/src/cocoa/button.mm +++ b/src/cocoa/button.mm @@ -52,8 +52,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID winid, wxButton::~wxButton() { - CocoaRemoveFromParent(); - SetNSButton(NULL); + DisassociateNSButton(m_cocoaNSView); } void wxButton::Cocoa_wxNSButtonAction(void) diff --git a/src/cocoa/checkbox.mm b/src/cocoa/checkbox.mm index 5181c7ceda..71fb5d4dc4 100644 --- a/src/cocoa/checkbox.mm +++ b/src/cocoa/checkbox.mm @@ -46,8 +46,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID winid, wxCheckBox::~wxCheckBox() { - CocoaRemoveFromParent(); - SetNSButton(NULL); + DisassociateNSButton(m_cocoaNSView); } void wxCheckBox::SetValue(bool) diff --git a/src/cocoa/control.mm b/src/cocoa/control.mm index 683448be99..eac63d12e3 100644 --- a/src/cocoa/control.mm +++ b/src/cocoa/control.mm @@ -48,8 +48,7 @@ bool wxControl::Create(wxWindow *parent, wxWindowID winid, wxControl::~wxControl() { - CocoaRemoveFromParent(); - SetNSControl(NULL); + DisassociateNSControl(m_cocoaNSView); } wxSize wxControl::DoGetBestSize() const diff --git a/src/cocoa/radiobut.mm b/src/cocoa/radiobut.mm index b3916b716b..c746b29502 100644 --- a/src/cocoa/radiobut.mm +++ b/src/cocoa/radiobut.mm @@ -47,8 +47,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID winid, wxRadioButton::~wxRadioButton() { - CocoaRemoveFromParent(); - SetNSButton(NULL); + DisassociateNSButton(m_cocoaNSView); } void wxRadioButton::SetValue(bool) diff --git a/src/cocoa/statbox.mm b/src/cocoa/statbox.mm index cc84875881..766f6773fb 100644 --- a/src/cocoa/statbox.mm +++ b/src/cocoa/statbox.mm @@ -39,8 +39,7 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID winid, wxStaticBox::~wxStaticBox() { - CocoaRemoveFromParent(); - SetNSBox(NULL); + DisassociateNSBox(m_cocoaNSView); } void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const diff --git a/src/cocoa/stattext.mm b/src/cocoa/stattext.mm index 521ae120e0..88574eeb03 100644 --- a/src/cocoa/stattext.mm +++ b/src/cocoa/stattext.mm @@ -45,8 +45,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID winid, wxStaticText::~wxStaticText() { - CocoaRemoveFromParent(); - SetNSTextField(NULL); + DisassociateNSTextField(m_cocoaNSView); } void wxStaticText::SetLabel(const wxString& label) diff --git a/src/cocoa/textctrl.mm b/src/cocoa/textctrl.mm index e0747d8983..e062ea4f42 100644 --- a/src/cocoa/textctrl.mm +++ b/src/cocoa/textctrl.mm @@ -44,8 +44,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID winid, wxTextCtrl::~wxTextCtrl() { - CocoaRemoveFromParent(); - SetNSTextField(NULL); + DisassociateNSTextField(m_cocoaNSView); } void wxTextCtrl::Cocoa_didChangeText(void) -- 2.45.2