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 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: > > > > 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 say: > > > > MyWidget.prototype = DynLayerConst > > for each widget. > > > > The only problem is when to create the DynLayerConst. It has to be > > done after the DynLayer has loaded and any of its extensions (like > > mouse.js). Any ideas? > > > > Rob > > > > _______________________________________________ > > Dynapi-Dev mailing list > > [EMAIL PROTECTED] > > http://www.mail-archive.com/dynapi-dev@lists.sourceforge.net/ > > > > _______________________________________________ > Dynapi-Dev mailing list > [EMAIL PROTECTED] > http://www.mail-archive.com/dynapi-dev@lists.sourceforge.net/ _______________________________________________ Dynapi-Dev mailing list [EMAIL PROTECTED] http://www.mail-archive.com/dynapi-dev@lists.sourceforge.net/