sandman
02-26-2003, 04:02 PM
Within a view I am displaying the following:
<text>
<a bold line> (a view with black background)
<text>
..
When an event occurs I remove all the subviews. Then on another user event I re-add the subviews. The text works fine but the height of the bold line increases to some random value. I essentially see a big black box. I am using the following method to delete subviews:
<method name="reset">
var sviews = this.subviews;
<![CDATA[
var i = sviews.length;
while (i > 0)
{
sviews[i-1].deleteNode();
--i;
}
]]>
</method>
I am using the following method to add sub views:
<method name="doSetUp">
this.tmpcharmSizeLabel = new charmSizeLabel(this);
this.tmpcharmSizeLabel.setAttribute ('sizeDescription', this.getAttribute('sizeDescription'));
this.tmpcharmSizeLabel.setAttribute('sizeId', this.getAttribute('sizeId'));
this.tmpcharmSizeLabel.setAttribute('width', 200);
this.tmpcharmSizeLabel.setAttribute('height', 100);
var charmSizeLabel_x = 30;
var charmSizeLabel_y = 10;
this.tmpcharmSizeLabel.setAttribute('x', charmSizeLabel_x);
this.tmpcharmSizeLabel.setAttribute('y', charmSizeLabel_y);
this.tmpcharmSizeLabel.doSetUp();
this.tmpview = new LzView(this);
this.tmpview.setAttribute('x', 15);
this.tmpview.setAttribute('y', 50);
this.tmpview.setAttribute('height', 2);
this.tmpview.setAttribute('width', 572);
this.tmpview.setAttribute('bgcolor', 'black');
</method>
When I call reset() and doSetUp() repeatedly I see the strange behavior.
<text>
<a bold line> (a view with black background)
<text>
..
When an event occurs I remove all the subviews. Then on another user event I re-add the subviews. The text works fine but the height of the bold line increases to some random value. I essentially see a big black box. I am using the following method to delete subviews:
<method name="reset">
var sviews = this.subviews;
<![CDATA[
var i = sviews.length;
while (i > 0)
{
sviews[i-1].deleteNode();
--i;
}
]]>
</method>
I am using the following method to add sub views:
<method name="doSetUp">
this.tmpcharmSizeLabel = new charmSizeLabel(this);
this.tmpcharmSizeLabel.setAttribute ('sizeDescription', this.getAttribute('sizeDescription'));
this.tmpcharmSizeLabel.setAttribute('sizeId', this.getAttribute('sizeId'));
this.tmpcharmSizeLabel.setAttribute('width', 200);
this.tmpcharmSizeLabel.setAttribute('height', 100);
var charmSizeLabel_x = 30;
var charmSizeLabel_y = 10;
this.tmpcharmSizeLabel.setAttribute('x', charmSizeLabel_x);
this.tmpcharmSizeLabel.setAttribute('y', charmSizeLabel_y);
this.tmpcharmSizeLabel.doSetUp();
this.tmpview = new LzView(this);
this.tmpview.setAttribute('x', 15);
this.tmpview.setAttribute('y', 50);
this.tmpview.setAttribute('height', 2);
this.tmpview.setAttribute('width', 572);
this.tmpview.setAttribute('bgcolor', 'black');
</method>
When I call reset() and doSetUp() repeatedly I see the strange behavior.