Whats the proper way to show a help field?

J. Landman Gay jacque at hyperactivesw.com
Wed Nov 19 14:59:46 EST 2014


On 11/19/2014, 1:18 PM, William Prothero wrote:
> Ok, let me see if I’ve got it.
>
>
> on mouseMove
> 	put myText into toolTip —?? i.e. how do I get text that depends on the mouseLoc, into the tooltip contents?
> 	set the tooltip of me to the mouseLoc
> end mouseMove

The mousemove message includes the mouse coordinates in its parameters, 
like this:

on mouseMove x,y
   set the tooltip of me to x,y
end mouseMove

This sets the text of the tooltip. You can't set its location by script, 
that is automatic. But there are some problems using tooltips this way:

1. There is a delay before the tooltip appears. By default it is a half 
second. You can adjust that though by setting the tooltipDelay when the 
stack opens.

2. The tooltip appears under the mouse the first time it is displayed, 
but if the mouse moves inside the same object while the tooltip is 
already showing, it will not follow the mouse. That may or may not be a 
problem, depending on what you're doing.

3. If the mouse moves out of the object and then back into it too 
quickly, sometimes the tooltip doesn't get the message and is ignored.

I've found that using a field that follows the mouse is more reliable 
and allows more control, although I do have one project that uses 
tooltips this way. LiveCode's app browser uses them too.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com





More information about the use-livecode mailing list