Hello Everyone,
I've been playing with a new feature that I've add to
dynapi called "Subclassing Events". Subclassing allows
a user to manipulate, modify, or even discard events
bound for other objects within dynapi, and in the
process changing the way in which the dynobjects
behaves.
This new fe
You are right. It would be a problem when you overwrite methods, because it
would overwrite all widgets methods. Oh well.
Rob
> You can do that because you'd be adding all methods from all widgets
> onto the same DynLayer prototype. There would be no distinction
> between a Label and Button w
You can do that because you'd be adding all methods from all widgets onto the same
DynLayer prototype. There would be no distinction between a Label and Button widget
except for their constructors.
Dan Steinman
On Wed, Jan 09, 2002 at 11:31:36AM -0500, Robert Rainwater wrote:
> I guess it is
I guess it is simpler than I thought:
DynLayer.getPrototype = function() {
if (!DynLayer._prototype) DynLayer._prototype=new DynLayer;
return DynLayer._prototype;
}
ex:
MyWidget.prototype = DynLayer.getPrototype();
> It seems a waste for every DynLayer subclass to do:
>
> MyWidg
It seems a waste for every DynLayer subclass to do:
MyWidget.prototype = new DynLayer;
The purpose here is to create the prototype chain from the DynLayer. So
why are we creating a new DynLayer for each widget. Why not reuse the
same object. Like saying:
DynLayerConst = new DynLayer;
then