What is the LiveCode equivalent property for the HTML <a title="some hover text"> parameter?

Richard Gaskin ambassador at fourthworld.com
Tue Jul 5 12:15:24 EDT 2011


Keith Clarke wrote:

 > I was using the <a> link description as an analogy to describe
 > the required behaviour. It's the effect of a tooltip on text
 > within a field that I want to create (and it's good to know
 > that this is not a standard thing that I have simply overlooked).
 >
 > I've tried the message watcher but there don't seem to be any
 > messages generated when the mouse traverses a change in textStyle
 > - i.e. the cursor doesn't change to a finger when over a link.
 > I hadn't really noticed this before but it seems strange as the
 > default behaviour. Is there maybe a property switch to enable
 > more orthodox cursor behaviour when over links in text?

LC's htmlText supports the name attribute, so you can use something like 
this:

<a name="Some text you want to display">Link Label</a>

...and then use a mouseMove handler to display that text:

on mouseMove  x, y
   get the linkText of the mouseChunk
   if it is not empty then
     DoSomethingWith it
   end if
end mouseMove

Good news about the name attribute in LC:  it renders without the blue 
underline, so it can be a good alternative to using a link with an href 
attribute if you want embedded metadata but don't want it render with 
the appearance of a link.

Bad news:  the name attribute is currently exclusive of the href 
attribute; you can have one or the other, but not both.

I've submitted an enhancement request to remedy that:
<<http://quality.runrev.com/show_bug.cgi?id=9347>>

In the meantime, the name attribute will probably do what you need 
unless you also need that same text run to have an href property.

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  LiveCode Journal blog: http://LiveCodejournal.com/blog.irv




More information about the use-livecode mailing list