Segmented Control Widget
J. Landman Gay
jacque at hyperactivesw.com
Thu Nov 5 15:10:57 EST 2020
On 11/5/20 1:47 AM, Terence Heaford via use-livecode wrote:
> I have been messing about with the Segmented Control Widget and have been trying to apply a tooltip.
>
> I noted that the tooltip can only be applied to the whole control, it does not appear possible to have a tooltip for each segment.
>
> Is this possible and if so could someone please advise.
I've done this with a custom control group, it should work with a widget too. Calculate the
rectangles (or at least the left and right edges) of each segment and in a mouseEnter handler
compare the mouseLoc to the rectangles to see which one it's in. Then set the tooltip to the
appropriate string. You can also add a mouseMove handler to do the same thing if you want to
change tooltips as the mouseLoc changes inside the widget.
If the updated tooltip doesn't display reliably, set the tooltip to empty, wait a millisecond
or so, and then set it to the new string.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list