From cffb22b7a9ba9e3023fc7ac66189cde067063c32 Mon Sep 17 00:00:00 2001 From: TheBestPessimist Date: Mon, 14 Aug 2023 14:25:45 +0300 Subject: [PATCH] Support tooltip overwriting/recreation --- lib/Tippy2.ahk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Tippy2.ahk b/lib/Tippy2.ahk index 0af892b..059dec7 100644 --- a/lib/Tippy2.ahk +++ b/lib/Tippy2.ahk @@ -43,6 +43,9 @@ class T this.DurationMs := durationMs this.TimeEnd := A_TickCount + DurationMs + if(T.Tooltips.Has(whichTooltip)) + T.OnTooltipExpired(whichTooltip) + T.Tooltips[whichTooltip] := this T.StartLoop() } @@ -87,7 +90,10 @@ class T } else { - WinMove(x, y,,, tt.Hwnd) + ; if a tooltip exists and is being shown then gets deleted in the constructor, this will throw an error. Swallow it + try { + WinMove(x, y,,, tt.Hwnd) + } } currentTooltipsHeights += tt.Height