I'm not sure what you mean by "passing arguments through a delegate", but does this forum-thread cover your requirements: "http://forum.openlaszlo.org/showthread.php?p=29523";

André


Yang wrote:
Ah, of course - thanks.

Is there any way to pass arguments through a delegate (aside from the
eventSender/eventName)?

Yang

On 7/16/07, André Bargull a.bargull-at-intensis.de |laszlo|
<...> wrote:
You also asked about anonymous functions for "LzDelegate".
After studying the sourcecode for "LzDelegate", I realized you actually
just need a simple object to get "LzDelegate" working.
That'd be:
[code]
var obj = new Object();
obj["myfunction"] = function(){ /*function-body*/ };
var del = new LzDelegate( obj, "myfunction" );
[/code]

Or as a short form:
[code]
LzTimer.addTimer( new LzDelegate( {func:function(){
  Debug.write( "Hello World!" );
}}, "func" ), 2000 );

var del = new LzDelegate( {func:function(a){
  Debug.write( "argument was:", a );
}}, "func" );

del.execute( "Hi, it's me!" );
[/code]

Bye,
André

Yang wrote:
>
> BTW, is there any way to pass an anonymous block of code to a timer
> (instead of creating and naming a method)? And is there any way to
> pass arguments through a delegate (aside from the
> eventSender/eventName)?
>
> Thanks,
>
> Yang

--
Mit freundlichen Grüßen,
André Bargull
Intensis GmbH

Tel.: +49 (0)231 5522-900
Fax.: +49 (0)231 5522-901
E-Mail: [EMAIL PROTECTED]
________________________________
Intensis GmbH
Ruhrallee 9
44139 Dortmund




--
Mit freundlichen Grüßen,
André Bargull
Intensis GmbH

Tel.: +49 (0)231 5522-900
Fax.: +49 (0)231 5522-901
E-Mail: [EMAIL PROTECTED]
________________________________
Intensis GmbH
Ruhrallee 9
44139 Dortmund

Reply via email to