lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Contextual-help anomaly


From: Vaclav Slavik
Subject: Re: [lmi] Contextual-help anomaly
Date: Fri, 29 Feb 2008 21:19:10 +0100
User-agent: KMail/1.9.9

Greg Chicares wrote:
> I would expect no control on this dialog to be associated with
> any contextual help whatsoever, because there are no <help>
> elements in its XRC file.

And rightly so. This was a bug in wx, it failed to remove wxWindow to 
help text association even after the window was destroyed. The 
bizarre behavior you observed is explained by the fact that the "Use 
built-in calculation summary" control was allocated at the same 
memory address previously used by "BlendGender" control. And because 
no new help text was set for this wxWindow* value and the old one was 
kept, wxSimpleHelpProvider incorrectly found help text when it 
shouldn't.

This patch to wx-2.8.x (will be in wx-2.8.8) fixes it:

Index: src/common/wincmn.cpp
===================================================================
--- src/common/wincmn.cpp       (revision 52197)
+++ src/common/wincmn.cpp       (working copy)
@@ -392,6 +392,14 @@
 #if wxUSE_ACCESSIBILITY
     delete m_accessible;
 #endif
+
+#if wxUSE_HELP
+    // NB: this has to be called unconditionally, because we don't
+    //     know whether this window has associated help text or not
+    wxHelpProvider *helpProvider = wxHelpProvider::Get();
+    if ( helpProvider )
+        helpProvider->RemoveHelp(this);
+#endif
 }

 void wxWindowBase::SendDestroyEvent()


Vaclav

-- 
PGP key: 0x465264C9, available from http://pgp.mit.edu/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]