]> git.saurik.com Git - wxWidgets.git/commitdiff
Ensure the tooltip has been created before enabling or setting the delay, or they...
authorJulian Smart <julian@anthemion.co.uk>
Fri, 29 May 2009 13:32:42 +0000 (13:32 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 29 May 2009 13:32:42 +0000 (13:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60792 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/tooltip.cpp

index a0441a3c193fedba3b68e167a08660cca3db35a2..9f99bec5c8282db574f68fa959bdeff5d9cf18a6 100644 (file)
@@ -215,11 +215,17 @@ LRESULT APIENTRY wxToolTipWndProc(HWND hwndTT,
 
 void wxToolTip::Enable(bool flag)
 {
+    // Make sure the tooltip has been created
+    (void) GetToolTipCtrl();
+
     SendTooltipMessageToAll(ms_hwndTT, TTM_ACTIVATE, flag, 0);
 }
 
 void wxToolTip::SetDelay(long milliseconds)
 {
+    // Make sure the tooltip has been created
+    (void) GetToolTipCtrl();
+
     SendTooltipMessageToAll(ms_hwndTT, TTM_SETDELAYTIME,
                             TTDT_INITIAL, milliseconds);
 }