changing textStyle on the fly

Toma Tasovac ttasovac at Princeton.EDU
Sun Dec 22 13:00:01 EST 2002


I have a field which has some words linked together.  Under certain 
conditions, I want the mouse click to disregard the link and handle the 
individual words which make up the link.  So I wrote a script to check 
if the clicked text is a link, change its textstyle to plain, pick up 
the word at clickLoc, do something with the word, and then make the 
originally cliked chunk into a link again.


on mouseDown theButton
   switch
   case theButton is 1
     put the textStyle of the selectedChunk into tStyle
     put the selectedChunk into tChunk
     if tStyle is "link" then
       set the textStyle of the selectedChunk to "plain"
       click at the clickLoc
       put the clickText after fld "Display"
       select tChunk
       set the textStyle of the selectedChunk to "link"
       hide groups
     else put the clickText after fld "Display"
     break
  end switch
end mouseDown

What am I doing wrong?  With the above script, I still get the linked 
words displayed together, not individually, as I would want them.

I'd be most grateful for any help.

Happy holidays to everybody!

Toma


________________________________
Toma Tasovac
Princeton University
Department of Comparative Literature
91 Prospect Avenue
Princeton, NJ 08544
USA

ttasovac at princeton.edu
ttasovac at post.harvard.edu




More information about the use-livecode mailing list