I vote again for Tucker's version.
P T Withington wrote:
I vote for mine! :P
On 2006-12-12, at 16:30 EST, Philip Romanik wrote:
I haven't checked in my change because there are 3 proposals of how to
handle it.
original:
<handler name="onwidth" >
if (this.getWidth() != 100)
this.setBGColor(0xFF0000);
</handler>
Jim:
<handler name="onwidth" >
if (this.isinited == false)
return;
this.setBGColor(0xFF0000);
</handler>
Tucker:
<handler name="onwidth">
this.setAttribute('bgcolor', this.width > 100 ? red : blue);
</handler>
Jim's and Tucker's example is better than my recommendation. I like
Tucker's better because it doesn't introduce the concept of isinited.
Any objections to me using Tucker's example? In Tucker's example,
bgcolor is not initialized in the view, and only in the event handler.
Thanks!
Phil
--
Regards,
Max Carlson
OpenLaszlo.org