Hotwords

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Hotwords

Post by quailcreek » Tue Feb 20, 2007 4:13 pm

Hello,
How do I build each line of a field into a hotword? I'm not sure if hotword is the correct term in Rev but that's what it's called in toolbook.

Regards
Tom

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte » Tue Feb 20, 2007 4:30 pm

Could you describe what a "hotword" does?

All the best,

Malte

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Post by quailcreek » Tue Feb 20, 2007 6:11 pm

Hi Malte,
A hotword is maybe called hypertext? It more less becomes an object with properties similar to and functioing like a button.

Tom

Bernard
Posts: 351
Joined: Sat Apr 08, 2006 10:14 pm

Post by Bernard » Tue Feb 20, 2007 6:27 pm

It's actually quite straightforward.
  • create a new mainstack
    create a field
    put some text into line 1 of the field
    lock the field
    type this in the message box (make sure the new stack is the one listed in the msg box)

    Code: Select all

    set the textStyle of line 1 of field 1 to "link"
    put this handler in the field:

    Code: Select all

    on linkClicked theText 
      if theText is not empty then answer "you clicked" && theText
    end linkClicked
    
Unfortunately the docs with Rev are in a sorry stated. Hard to believe that the PDF docs are still incomplete about a year after v.2.7 was released.

Obviously you can start adding more text to the field to experiement with associating the link with other parts of text. And you can add to that basic handler to do lots of useful stuff.

Post Reply