Foregroundcolor stuck?

Jan Schenkel janschenkel at yahoo.com
Fri Dec 6 11:20:00 EST 2002


--- "Glasgow, David"
<David.Glasgow at cstone-tr.nwest.nhs.uk> wrote:
> I have a field that I want to display in grey and
> then change word by word to black.
> 
> In a preopencard handler I have:
> 
> if there is a field itemshow then send greyme to
> field itemshow
> 
> Then in field itemshow I have:
> 
> on greyme
>   set the foregroundcolor of me to gray
> end greyme
> 
> on showme
>   wait 40 ticks
> repeat with j=1 to the number of words of me
>   set the foregroundColor of word j of me to black
>   wait 30 ticks
> end repeat
> end showme
> 
> 
> The text doesn't go grey.  I don't even seem able to
> change the text colour via the colour palette or the
> colour options in the text menu.  It just stays
> stubbornly black.  If I 'put' the foregroundcolor it
> returns a grey (232,232,232).
> 
> I would shrug my shoulders and make a new field, but
> it appears on many cards with different text on
> each, and I don't want to type it all in again.  I
> have duplicated the field, and the duplicate stays
> stuck.  I have made a new field with a bit of text,
> and I can change text colour no problem.
> 
> Is there some weird property I have set by mistake?
> 
> (incidentally, full version, 1.1.1 on Win 2000) 
> 
> Best wishes,
> 
> David Glasgow
> 

Hi David,

The thing is that once you set the colour of certain
words, you have to reset the colour of the entire
"chunk" of text, because otherwise it's overridden by
the colour of the individual words.

Try this:

on greyme
  set the textColor of char 1 to -1 of me to "gray"
end greyme

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the use-livecode mailing list