Inheritance in Revolution?

Richard Gaskin ambassador at
Mon Sep 13 15:45:43 EDT 2004

Dave LeYanna wrote:

> 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.

Rather than having the code in the button itself, you might be happier 
in the long run putting those scripts into a library, and adding a 
MakeWidget handler there to set up the new object.

That way all your code's in one place, so if you want to enhance the 
behavior or fix a bug you do it in just one place and every object that 
calls that library benefits.

  Richard Gaskin
  Fourth World Media Corporation
  Ambassador at

More information about the use-livecode mailing list