From: Julian Smart <julian@anthemion.co.uk> Date: Fri, 29 May 2009 13:32:42 +0000 (+0000) Subject: Ensure the tooltip has been created before enabling or setting the delay, or they... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a7d8506b4f49e43d7ebe29c4f336d6e3a11c2a08 Ensure the tooltip has been created before enabling or setting the delay, or they will be no-ops. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60792 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index a0441a3c19..9f99bec5c8 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -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); }