Inheritance in Revolution?
Frank Leahy
frank at backtalk.com
Mon Sep 13 15:13:33 EDT 2004
On Sep 11, 2004, at 11:58 PM, use-revolution-request at lists.runrev.com
wrote:
> From: Richard Gaskin <ambassador at fourthworld.com>
> Subject: Re: Inheritance in Revolution?
> To: How to use Revolution <use-revolution at lists.runrev.com>
> Message-ID: <41437564.60804 at fourthworld.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Arthur Urban wrote:
>
>>>> There is something similar that's been in
>>>> discussion and will hopefully be
>>>> implemented in the next version (or the one
>>>> after that), and it's being
>>>> called "parentScripts". Sort of an
>>>> object-specific "backscript", you can
>>>> assign the script of an object as the
>>>> "parentScript" to one or more other
>>>> objects. This would allow 25 buttons to use the
>>>> same script of its parent.
>>>
>>> isn't this what a group script for
>>> 25 grouped buttons should do?
>>
>>
>> Sure. But what if your 25 buttons aren't on the same card or the same
>> stack?
>> They may still all need the exact same behaviour.
>
> Use a frontscript that differentiates based on a property setting.
Why not create a script "MyButtonScript" (for example), and then call
it in each button's "on mouseDown" (or mouseUp, or any other handler)?
In button:
on mouseDown
MyButtonScript
end mouseDown
In home stack, or in a stack that you've done a start using on:
on MyButtonScript
-- do common stuff here
end MyButtonScript
I know it's not "inheritance" per se, but it has the same general
impact at runtime. Or did I miss something about what you want to do?
As for parent scripts, sounds interesting, but it will be interesting
to see how they're implemented, and whether (and how) you'll be able to
override specific handlers on a per button instance basis.
-- Frank
Web Photos Pro: Software for Photo Bloggers and Other Photo Power Users
See us on the web at http://www.webphotospro.com/
More information about the use-livecode
mailing list