how to set the textStyle of word 1 of the selection?
Andre.Bisseret
Andre.Bisseret at inria.fr
Wed Mar 17 06:33:36 EDT 2010
Le 17 mars 10 à 03:24, J. Landman Gay a écrit :
> J. Landman Gay wrote:
>> J. Landman Gay wrote:
>>> Andre.Bisseret wrote:
>>>
>>>> Then, I am looking for a solution. I will try to control the
>>>> selection made by the user and to edit it.
>>>
>>> Does this work?
>>>
>>> on mouseUp
>>> get the selection
>>> put word 1 of it into tWord
>>> if tWord = "" then exit mouseUp
>>> put (word 2 of the selectedchunk)-1 into tStart
>>> set the textstyle of char (offset(tWord,it))+tStart to \
>>> len(tWord)+tStart of fld 1 to "link"
>>> end mouseUp
>>>
>> Answering my own question: no, it doesn't. Not in all cases. Only
>> in some.
Bonjour Jacque,
Done masterfully ;-))
>
> So I'm being really stupid today. This should have been pretty
> obvious:
Yes this should have been so… Conclusion : "I" am stupid ;-O))))
Actually I think I would not have had this idea of selecting a part of
a selection!
>
> on mouseUp
> select word 1 of the selection
> if the number of words in the selection = 0 then exit mouseUp
> set the textstyle of the selectedChunk to "link"
> end mouseup
>
> Like, duh.
Only 3 lines and forgotten any problem of spaces, tabs, crs, etc ...
Magnifique !
This thread was a bit like a slalom! You are clearly the golden medal
winner :-))
Thank you a lot Jacque
Best regards from Grenoble
André
P.S. I still play "JQ Boggle" a lot. But got a conflict with the other
game I am addicted to: "tRev", where "command + R" shifts from Rev to
tRev and vice versa. So that I have to quit tRev to be able to rescore
in JQ Boggle. Might be I should report that to the RQCC ;-O))))))
More information about the use-livecode
mailing list