Add auto-hide timeout for Tooltip
Posted: 20 Feb 2024, 02:03
Implement an auto-hide timeout parameter so that we don't have to use SetTimer or a custom function like below to hide it. I think it's frequent enough we need to hide the tooltip. This is especially helpful for new users.
My suggestion for the parameter:
ToolTip [Text, X, Y, WhichToolTip-or-Timeout]
WhichToolTip-or-Timeout
Code: Select all
Tip(Text := "", Time := 1500, X?, Y?) {
Tooltip(Text, X?, Y?, 20)
SetTimer () => Tooltip(,,,20), -Time
}
ToolTip [Text, X, Y, WhichToolTip-or-Timeout]
WhichToolTip-or-Timeout
Type: Integer
If omitted, it defaults to 1 (the first tooltip). Otherwise, specify a number between 1 and 20 to indicate which tooltip to operate upon when using multiple tooltips simultaneously. If the number is greater than 20, it will be taken as the delay in milliseconds before hiding the tooltip. The tooltip being operated upon will be unnumbered and outside the set of 20 tooltips.