|
From: Barre B. <ba...@ho...> - 2000-11-24 16:33:10
|
Another thing...
Is there a way of extending methods?
Have been struggling with this a couple of hours now... and
I can't get past the fact that when you create a widget
that "extends" DynLayer and you want it to extend various
methods,it seems that you have to rewrite the methods in
full.
There should be a better way of doing this also.
/Bart
> hmm seems kindof obscure..
> It strikes me as having a construct method to be a
cleaner
> way of doing initialization.. almost like calling super()
> in Java... hm?
> (The code below should work)
>
> function DynLayer() { this.construct(arguments) }
> DynLayer.prototype.construct=function(){
> var a=arguments[0]
> ........etc.......
>
> function widget(){
> this.construct(arguments)
> }
> widget.prototype=new DynLayer
>
>
> > Forget what I wrote.... it should be this instead:
> >
> > function widget(argarray) {
> > this.DynLayer = DynLayer
> > eval("this.DynLayer("+argarray.join(",")+")")
> > }
> > widget.prototype = new DynLayer
> >
> > /Lunna
|