At runtime, colors must be integers.  setAttribute should work, but  
you need to use 0xff0000, not '#ff0000'.

This is a common error, and there is an enhancement request to fix  
this: http://www.openlaszlo.org/jira/browse/LPP-1640

On 2006-04-12, at 07:39 EDT, Robin wrote:

> How can I set the colour of a text field from a script?
> setAttribute('fgcolor',...) doesn't work, neither does doing  
> something like
>         label.setText("<font color=\"#FF0000\">"+string+"</font>");
>
> All the examples I can find involve having the content in between
> <text>...</text>, which doesn't work in this case, as the string is  
> generated
> at runtime, and the labels are recycled too.
>
> Thanks, Robin.
> _______________________________________________
> Laszlo-user mailing list
> [email protected]
> http://www.openlaszlo.org/mailman/listinfo/laszlo-user

_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to