X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77d4384e31b10791b3b074b9874c73f5df004556..4a45223c970eabf6ba66347129627775935c90b3:/src/common/cshelp.cpp?ds=sidebyside diff --git a/src/common/cshelp.cpp b/src/common/cshelp.cpp index 60e595f156..3921a21c96 100644 --- a/src/common/cshelp.cpp +++ b/src/common/cshelp.cpp @@ -305,10 +305,21 @@ void wxSimpleHelpProvider::AddHelp(wxWindowID id, const wxString& text) bool wxSimpleHelpProvider::ShowHelp(wxWindowBase *window) { + static wxTipWindow* s_tipWindow = NULL; + + if (s_tipWindow) + { + // Prevent s_tipWindow being nulled in OnIdle, + // thereby removing the chance for the window to be closed by ShowHelp + s_tipWindow->SetTipWindowPtr(NULL); + s_tipWindow->Close(); + } + s_tipWindow = NULL; + wxString text = GetHelp(window); if ( !text.empty() ) { - new wxTipWindow((wxWindow *)window, text); + s_tipWindow = new wxTipWindow((wxWindow *)window, text, 100, & s_tipWindow); return TRUE; }