I wanted to get rid of the deprecated "applyConstraint" call in
gridtext, which looks like

-                    var f = function() {
-                                this.setAttribute("x", this._calcX());
-                            }
-                    var d = [this, "width"];
-                    this.applyConstraint("x", f, d);

 so I replaced it with the LZX constraint on "x"


+                  x="${ this._calcX() + this.width * 0}"


which  should be equivalent; it has a dependency on "width", but
multiplies it by zero, and calls the _calcX() method
which is what the original applyConstraint was doing.  So this should
do the same thing as the original call to applyConstraint, right?



Index: gridtext.lzx
===================================================================
--- gridtext.lzx        (revision 8323)
+++ gridtext.lzx        (working copy)
@@ -66,6 +66,7 @@
             <text visible="${!parent.editing}" width="${parent.width}"
                   resize="false"
                   y="${ parent.height /2 - this.height/2}"
+                  x="${ this._calcX() + this.width*0}"
                   fgcolor="${ parent.immediateparent.selected ?
                                     classroot._textselectedcolor:
                                     (parent.immediateparent.highlighted ?
@@ -76,11 +77,6 @@
                 <handler name="oninit">
                 <![CDATA[
                     this.setAttribute('selectable', classroot.selectable);
-                    var f = function() {
-                                this.setAttribute("x", this._calcX());
-                            }
-                    var d = [this, "width"];
-                    this.applyConstraint("x", f, d);
                 ]]>
                 </handler>



-- 
Henry Minsky
Software Architect
[EMAIL PROTECTED]

Reply via email to