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


Reply via email to