Many thanks for looking into this Ben, and for the corrections to my  
test case.

> There is probably a simple workaround -- set multiline to true  
> once, leave it that way, just change the height --

The problem with this is what to set the height to? As far as I'm  
aware, there's no way of measuring how many lines of text the string  
will wrap to upon setting the width of the container. I could use a  
guestimate, but it's likely that the text will either be cropped or  
the run-on will be too big, displacing elements below.

> but I looked into this and got interested in a potential bug. It  
> seems like there is something not updating correctly. The case  
> below shows that changing the value of the multiline attribute at  
> runtime does not cause the text to wrap.

Yes - it does seem odd. I looked into it some more, and noticed that  
the multiline attribute is of type "final," which means it shouldn't  
be possible to change it with script after setting it in the tag.  
This is confusing - I can use brute force to change it by specifying  
the height and width, but can't script it directly.

Is there any way I could do something along the lines of:

if (parent.multi > 0){
     //use this text element, with multiline set to true:
     <text multiline = "true" etc etc />
}else{
     //use this text element with multiline set to false:
     <text multiline = "false" etc etc />
}

This would seem the ideal workaround to me, but I'm unsure of how to  
script it so that only one text element is committed to the canvas  
based on an a conditional statement.

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

Reply via email to