[Laszlo-dev] how do I add an oninit handler?
Jim Grandy
jgrandy at openlaszlo.org
Wed Jun 27 11:37:37 PDT 2007
I think the idea is to prepare a patch that may be used against 3.3.3
with the simple inclusion of an lzx file. We may do a 3.4.3, but
3.4.x was never fully qualified and so for most OpenLaszlo users
3.3.3 is the end of the 3.x line.
jim
On Jun 27, 2007, at 11:24 AM, P T Withington wrote:
> Yes.
>
> Take the entire definition that starts:
>
> LzText.prototype.construct = function ( parent, args ) {
>
> add your code to that, and put it in a <script> block so that it
> replaces the LFC definition.
>
> On the assumption that there may yet be one last 3.x release, you
> might get the svn masters to allow you to check in your change to
> trunk also.
>
> On 2007-06-27, at 14:19 EDT, Benjamin Shine wrote:
>
>> When you say "patch the LzText.prototype.construct method" do you
>> mean "override the LzText.prototype.construct method with a
>> modified version of what LzText.prototype.construct used to be"?
>>
>> Again, may I please have more details on the pattern you are
>> suggesting?
>>
>> On Jun 27, 2007, at 9:46 AM, P T Withington wrote:
>>
>>> You have described something akin to what we would _like_ our API
>>> to be. :)
>>>
>>> But, you can't really do what you want this way because you
>>> really need to affect the initialization of each instance of an
>>> LzText object. That is, you really need the event sender to be
>>> the instance that is being inited, and you can't know that.
>>>
>>> I think the best approach would be to "patch" the
>>> LzText.prototype.construct method and send that out as a script
>>> block. It would have to be the first thing that happened in any
>>> app.
>>>
>>> On 2007-06-27, at 12:23 EDT, Benjamin Shine wrote:
>>>
>>>>
>>>> In 3.3 and 3.4, how do I add an oninit handler to LzText? I want
>>>> to make the special font setup foo available to users of 3.3 and
>>>> 3.4 without needing to re-release or re-compile the LFC.
>>>> Something like...
>>>> <script>
>>>> LzText.addDelegate( "oninit", function()
>>>> { this.__LZtextclip.antiAliasType = "advanced" } );
>>>> </script>
>>>>
>>>> ...but I'm sure I don't have quite the right syntax. Please advise.
>>>>
>>>> -ben
>>>
>
More information about the Laszlo-dev
mailing list