A better answer.

Most widgets inherit from some class (superClass), be it DynLayer, DynImage,
Viewport or another.  This means you can use the methods of the superclass
with implicit calls such as:

myLayer.setBgImage

without it you would be allot more verbose

SuperWidgetSetImage(img) {
        var img = img
        DynLayer.setBgImage(img)
}

A interesting Widget to study is Scrollpane.  It uses a sloppy form of
multiple inheritance.  It inherits from Viewport but if you look way down on
the bottom you will see explicit calls to "DynImage.getImage()" in the
MetalScrollPane() function.  Since it doesn't inherit from DynImage these
called need to be explicit.

Hope it helps,

Ray

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Colin
Thompson
Sent: Saturday, May 12, 2001 1:00 AM
To: Dynapi-Help
Subject: [Dynapi-Help] correct format of widgets


Just a simple question,

I've noticed that the tutorials by Pascal use this format:

        function widget(id,x,y,w,h) {
                this.superClass=DynLayer
                this.superClass(id,x,y,w,h)

yet all the 'core' widgets use this.DynLayer. What is the difference between
the 2? is there a consequence of using one over the other?




_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.252 / Virus Database: 125 - Release Date: 5/9/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.252 / Virus Database: 125 - Release Date: 5/9/2001


_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to