[Laszlo-dev] For Review: Change 20061211-Philip-6 Summary: Modify l-in-10 scripting->event application
P T Withington
ptw at openlaszlo.org
Mon Dec 11 14:00:28 PST 2006
There is no code in the example to set it back.
If that is what you want to demonstrate, use something like:
this.setBGColor(this.width > 100 ? blue : red);
and add another button. But I like the current example's setup
because it brings up the issue of handlers having to verify their pre-
conditions (as I said in previous mail).
On 2006-12-11, at 16:29 EST, Jim Grandy wrote:
> The problem is this won't work if you try to set the width back to
> 100.
>
> Can you use something like
>
> if (this.isinited == false)
> return;
> this.setBGColor(0xFF0000);
>
> ?
>
> jim
>
> On Dec 11, 2006, at 1:08 PM, Philip Romanik wrote:
>
>> The latter. The behavior is now consistent between swf and flash,
>> but with the current initialization, the onwidth() event turns the
>> box red immediately. The box should be blue until the user clicks
>> on the button.
>>
>> This change makes the initialization order moot.
>>
>>
>>> This was not fixed by Henry's event deferral patch?
>>>
>>> Or are you saying that the behavior is now consistently not what is
>>> desired on both platforms?
>>>
>>> On 2006-12-11, at 15:54 EST, Philip Romanik wrote:
>>>
>>> >
>>> > Change 20061211-Philip-6 by Philip at Philip-DC on 2006-12-11
>>> 15:42:37
>>> > EST
>>> > in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/branches/legals
>>> >
>>> > Summary: Modify l-in-10 scripting->event application
>>> >
>>> > New Features:
>>> >
>>> > Bugs Fixed: LPP-3247
>>> >
>>> > Technical Reviewer: ptw
>>> > QA Reviewer: (pending)
>>> > Doc Reviewer: (pending)
>>> >
>>> > Documentation:
>>> > The existing app doesn't work as intended because of an
>>> > initialization issue. The onwidth() event is fired during
>>> > initialization and this turns the view blue. The intent of the
>>> demo
>>> > is to show an event being fired when the user clicks on a button.
>>> >
>>> > My first thought was to make sure the object was fully initialized
>>> > before enabling the onwidth event. The problem is that it will
>>> make
>>> > the app look more complicated. I took an easier route and changed
>>> > the onwidth() method to only turn the view red if the size changes
>>> > from the initial value. There are lots of ways to solve this issue
>>> > and the simplest is to hard-wire the initial width into a
>>> > conditional. I changed
>>> >
>>> > <handler name="onwidth" >
>>> > this.setBGColor(0xFF0000);
>>> > </handler>
>>> >
>>> > to
>>> >
>>> > <handler name="onwidth" >
>>> > if (this.getWidth() != 100)
>>> > this.setBGColor(0xFF0000);
>>> > </handler>
>>> >
>>> > This change requires no explanation to the reader.
>>> >
>>> > Release Notes:
>>> >
>>> > Details:
>>> >
>>> >
>>> > Tests:
>>> > Run l-in-10 scripting->events in swf and flash
>>> >
>>> > Files:
>>> > M laszlo-explorer/scripting/events.lzx
>>> >
>>> > Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20061211-
>>> > Philip-6.tar
>>> >
>>> >
>>
>
More information about the Laszlo-dev
mailing list