[Laszlo-dev] RE: Idle callbacks are the devil's tools!

Mark Davis mdavis at laszlosystems.com
Thu Jun 9 21:52:15 PDT 2005


Oliver Steele wrote:

> On Jun 9, 2005, at 8:22 PM, mdavis wrote:
>
>> Max Carlson wrote:
>>
>>> This seems like a bad idea to me.  I've had a lot of cases where I  
>>> wanted to bind a method to an event, invoke it by name directly.
>>>
>>> Another thing that would be nice is if onevent could take a list,  
>>> allowing a single method could bind to multiple events.  One case  
>>> where I've wanted this is when I want a drawview to redraw when  its 
>>> height or width are changed.  As of now, I have to have the  event 
>>> bindings invoke a third method.
>>>
>>>
>> I'm with Max here. having the distinction between name= and event=  
>> is a good thing. It may seem silly to have code like:
>> <method event="onconstruct">
>>  redraw();
>> </method>
>> <method event="onwidth">
>>  redraw();
>> </method>
>> <method event="onheight">
>>  redraw();
>> </method>
>> <method event="onvalue" reference="parent.slider">
>>  redraw();
>> </method>
>> <method name="redraw">
>> ....
>> </method>
>>
>> But boy is it easy to manage.
>
>
I threw you a curveball :)

> Easier than this?
>
>   <method name="onvalue" reference="parent.slider">
>     redraw();
>   </method>

So how do you manage:
  <method name="onvalue" reference="parent.slider">
    redraw();
  </method>
  <method name="onvalue" reference="parent.textarea.text()">
    redraw();
  </method>

?


More information about the Laszlo-dev mailing list