Saving colour info in a list field

Jan Schenkel janschenkel at yahoo.com
Thu Dec 19 03:52:01 EST 2002


--- " Ian McKnight (MM)" <ianmck at macmail.com> wrote:
> Hi
> 
> I have a list field which is populated by
> approximately 30 names. I have
> scripted the field to change the colour of the
> clicked text to red, using
> forecolor, to show that that selection has been
> made.
> 
> My problem is that I want to re-populate the list
> with a different list,
> restoring the 'old' list along with any colour
> changes at a later date.
> 
> I have noticed that when I put the contents of the
> list into a variable and
> restore the variable -- the colour disappears.
> However when the variable is
> re-populated a line at a time with different data,
> the colour information
> stays with the line position.
> 
> Is there an easy way to do this, that is to store
> the colour data along with
> the list? I looked at HTML in the dictionary but it
> seems to apply to whole
> fields.
> I know that I could put the lists into buttons and
> use checkmarks
> to show past selections but I was hoping to a little
> more colourful.
> 
> Any suggestions, advice or references would be very
> much appreciated.
> 
> Thank you.
> 
> 
> Ian McKnight
> 

Hi Ian,

I've found that a very helpful exercise was to make a
new stack with two fields: one field where I'd type
the text, and another field right next to the field I
wanted to learn more about, and then type in the
message box:
  put the HTMLText of field "foo" into field "bar"
This allows you to have a look at how the style and
colour information is stored away inside the field, so
you can devise new strategies to update your data and
apply the appropriate colour scheme.
So toy around with it in the second field, and see how
changes to the HTML reflect the look by updating the
other field by typing in the message box:
  set the HTMLText of fld "foo" to (fld "bar")

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