[Dynapi-Dev] Subclassing EventObjects in DynAPI

2002-12-06 Thread Raymond Irving
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

Re: [Dynapi-Dev] Subclassing

2002-01-09 Thread Robert Rainwater
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

Re: [Dynapi-Dev] Subclassing

2002-01-09 Thread Dan Steinman
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

Re: [Dynapi-Dev] Subclassing

2002-01-09 Thread Robert Rainwater
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

[Dynapi-Dev] Subclassing

2002-01-09 Thread Robert Rainwater
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