[Laszlo-dev] loadable libraries compiled into main app

Henry Minsky henry.minsky at gmail.com
Wed Feb 9 10:05:18 PST 2005


There's a spec for <import> tag. It's on the internal wiki.
http://perforce.laszlosystems.com/perforce//docs/platform/designs/libraries.html
and on the openlaszlo wiki someplace under Dynamic Libraries. However
what's spec'ed doesn't match what's implemented.

Examples of what is implemented are:

<canvas>
  <import name="lib" href="view-library.lzx" oninit="lib.load()" />
</canvas>


view-library.lzx:
<library>
  <text>Loaded</text>
</library>



importing a lib with a class, use of onload event:
<canvas width="1024">
  <import name="lib" href="class-library.lzx" 
	  oninit="lib.load()"
	  onload="canvas.doLoaded()"/>
  <method name="doLoaded">
    new myclass(canvas, {fontsize: 8, text: '[1] loaded myclass'});
    new myclass(canvas, {fontsize: 10, text: '[2] loaded myclass'});
    new myclass(canvas, {text: '[3] loaded myclass'});

  </method>
  <simplelayout spacing="2" />

<myclass fontsize="22" text="[4] loaded myclass (tag)"/>
</canvas>



class-library.lzx:
<library>

  <class name="myclass" bgcolor="#ffccff" 
	 width="${this.textview.width}"
	 height="${this.textview.height}" fontsize="20">
    <attribute name="text" type="text"/>
    <text name="textview"  resize="true" text="${parent.text}"/>
  </class>

</library>







The syntax may change a little. 




On Wed, 9 Feb 2005 12:28:48 -0500, John Sundman
<jsundman at laszlosystems.com> wrote:
> Henry,
> 
> Can you elaborate on the meaning of the phrase "we have the
> infrastructure"?
> 
> Does this work now in b2?
> 
> I'm adding some content to the "Performance tuning" chapter and would
> like to mention this if it's indeed working now.
> 
> (As always, working code examples make the Doc Guy happy, hint, hint.)
> 
> jrs
> 
> P.S. Sarah's contextualizing comment duly noted also.
> 
> On Feb 9, 2005, at 11:32 AM, Henry Minsky wrote:
> 
> > It occurred to us that now that we have the infrastructure for
> > loadable libraries, such as the LzLibrary object, onload callback
> > event, and the hook to tell the canvas to instantiate any new stuff
> > declared in the library, that we could just emit the library swf code
> > into additional frames in the main app.
> 
> _______________________________________________
> Laszlo-dev mailing list
> Laszlo-dev at openlaszlo.org
> http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
>


More information about the Laszlo-dev mailing list