[Laszlo-user] horizontal rule between components

Adam Wolff adam at laszlosystems.com
Tue Apr 11 12:00:35 EDT 2006


you should consider pooling your hrules. destroy can leak pretty easily 
and if nothing else, it's often slow.

A

On Apr 11, Robin wrote:

> Dan Stowell wrote:
> > That could get a bit messy, but is otherwise a great idea. Layouts are
> > for coordinating visual state between different views - that's what
> > you're trying to do here.
> I ended up going with a layout, it's going to be part of a custom component
> anyway, so that's fine. I got it working, however part of the update() method
> contains:
> for (var i=0; i < c; i++) {
> 	var v = new hrule();
> 	v.setAttribute('width', this.parent.width);
> 	v.setAttribute('bgcolor', this.linecolor);
> 	this.addSubview(v);
> }
> 
> where 'c' is calculated as the number of hrules there should be, and is simply:
> 
> <class name="hrule" extends="view" x="0" height="1" />
> 
> for some reason I can't understand, the this.addSubview call seems to add the
> hrule to the canvas, rather than the view that contains the layout. This means
> that if I move the view away from x=0, y=0, the lines don't shift with it. How
> can I make the layout add things to the view?
> 
> Robin.
> _______________________________________________
> Laszlo-user mailing list
> Laszlo-user at openlaszlo.org
> http://www.openlaszlo.org/mailman/listinfo/laszlo-user
> 


More information about the Laszlo-user mailing list