I think the way I would avoid the yuck would be to define a subclass (in LZX) and instantiate that, instead. The yuck that you have to do, all happens for free in lzx, courtesy of the tag compiler.
Perhaps there will be less yuck in the new class model! On 7 Feb 2006, at 11:16, Jim Grandy wrote: > And here's the changeset: > <changeset-38637.zip> > > On Feb 6, 2006, at 9:23 PM, Jim Grandy wrote: > >> [Ben, can you integrate this into your branch and see if it works >> well with your code? Tucker, I'm asking you to review this because >> of the yucky method I used to add an init method override to a >> dynamically instantiated instance. Please tell me there's a better >> way!] >> >> Change 38637 by [EMAIL PROTECTED] on 2006/02/06 21:06:25 *pending* >> >> Summary:List and two incubator components can now have custom >> scrollbar classes. Also, remove redundant newlist. >> >> New Features:New list attribute, @scrollbarclassname. >> >> Bugs Fixed:LPP-1495 LPP-1536 LPP-1498 >> >> Technical Reviewer: ptw ben >> QA Reviewer: frisco >> Doc Reviewer: jsundman >> >> Release Notes:List scrollbar can now be customized by giving a >> @scrollbarclassname attribute. The incubator classes scrolledittext >> and scrollrichedittext can be similarly customized by supplying the >> @vscrollbarclassname attribute. >> >> >> Details:Used runtime instantiation to create scrollbar instance at >> init time using given custom class name. >> >> For list, this was straightforward: just a call to 'new >> global[this.scrollbarclassname]' with the right parameters. >> >> For scrolledittext and scrollrichedittext, things were more >> complicated because the vscrollbar instance used in those classes >> contained constrained attributes, and those constraints were >> required to be in place when basescrollbar.init was called. >> >> The solution was to write a custom init method for the scrollbar >> instance that applied the appropriate constraints and then called >> super.init. Forgive me for the use of #pragma "methodName=init", but >> I believe that's the only way of getting this to work. >> >> I also made two changes to basescrollbar: a explicit declaration for >> the onscrollmax event, and changing a direct assignment to >> @scrollmax into a call to setAttribute. >> >> Removed incubator/newlist because it was redundant with lz/list once >> we had customizable scrollbars. >> >> Tests:tests modified below, runlzunit, Laszlo Explorer >> >> Affected files ... >> >> ... //depot/lps-dev/lps/components/base/basescrollbar.lzx#11 edit >> ... //depot/lps-dev/lps/components/incubator/newlist.lzx#1 delete >> ... //depot/lps-dev/lps/components/incubator/rich-text/ >> scrollrichedittext.lzx#2 edit >> ... //depot/lps-dev/lps/components/incubator/scrolledittext.lzx#2 >> edit >> ... //depot/lps-dev/lps/components/incubator/test/scrolledittext- >> test.lzx#1 edit >> ... //depot/lps-dev/lps/components/incubator/test/test- >> edittext.lzx#2 edit >> ... //depot/lps-dev/lps/components/lz/list.lzx#7 edit >> ... //depot/lps-dev/test/components/lz/test-list.lzx#2 edit >> >> >> [ATTACH CHANGESET] >> _______________________________________________ >> Laszlo-dev mailing list >> [email protected] >> http://www.openlaszlo.org/mailman/listinfo/laszlo-dev > _______________________________________________ Laszlo-dev mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
