From 440e477ea74a9bb94dad732fab85cd20a0c74a4a Mon Sep 17 00:00:00 2001 From: Tim Kosse Date: Mon, 5 Jan 2015 12:49:41 +0000 Subject: [PATCH] On wxMac, modal event loops avoid deleting pending objects. Hide the text control after editing a label in the generic tree control so it does not remain visible e.g. if the tree control is used in a dialog. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78350 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/treectlg.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index b81a0b4f09..870f0ded05 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -515,6 +515,13 @@ void wxTreeTextCtrl::Finish( bool setfocus ) { m_owner->ResetTextControl(); +#ifdef __WXMAC__ + // On wxMac, modal event loops avoid deleting pending objects. + // Hide control so it does not remain visible e.g. if the tree + // control is used in a dialog. + Hide(); +#endif + wxPendingDelete.Append(this); if (setfocus)