Inheritance in Revolution?

Dave LeYanna dleyanna at netvalues.com
Mon Sep 13 15:41:38 EDT 2004


Is there a way (perhaps using externals?) to add new, custom object
"templates" on the Tools palette? If this were possible then one could make
a "special" button that had script already attached, certain properties
already set and so on. These scripts and properties would be "inherited"
from the object template on the tool palate.

The new button on the card could even look for it's script's functionality
in a script that was created by the external and placed in the stack's
script at run time. This would allow a change in the "template object"
script to flow through to object on any stack that used that template. To
update a compiled stack, just recompile.

Clear as mud?
\
Dave

-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Frank Leahy
Sent: Monday, September 13, 2004 3:14 PM
To: use-revolution at lists.runrev.com
Subject: Re: Inheritance in Revolution?


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/

_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution



More information about the use-livecode mailing list