"immediately" is at load time, it is the default, but should only be used for constant expressions.

"once" is at init time, it can refer to other nodes that precede this one.

"always" is a constraint, it will track changes in the referred to values.

Here's a slightly more obvious example:

<canvas>
  <simplelayout spacing="5" />
  <slider id="m" value="25" minvalue="0" maxvalue="100" />
  <text text="$immediately{'immediately: ' + m.value}" />
  <text text="$once{'once: ' + m.value}" />
  <text text="$always{'always: ' + m.value}" />
</canvas>

On 2008-05-22, at 14:53 EDT, Lou Iorio wrote:

I'm looking at LPP-2037.

I'd like to provide a simple example that illustrates the different values for
constraints in tags, something like this:

<canvas>
   <view x="250" width="20" height="20" bgcolor="red" y="$once{m.y}"/>
<view x="280" width="20" height="20" bgcolor="blue" y="$immediately{m.y}"/> <view x="310" width="20" height="20" bgcolor="green" y="$always{m.y}"/>
   <window id="m" x="10" title="Drag me" width="160" height="20"/>
</canvas>

I don't understand the difference between "once" and "immediately", and this
example doesn't illustrate the difference.

What's the difference, and is there a better example I can use?

Thanks,

Lou



Reply via email to