From: aa8vb at vislab.epa.gov (Randall Hopper)
Date: Mon, 5 Apr 1999 16:20:58 GMT
Subject: Subattributes of classes
In-Reply-To: <3708D83E.BBE87D60@appliedbiometrics.com>; from Christian Tismer on Mon, Apr 05, 1999 at 05:35:26PM +0200
References: <19990405104408.A807008@vislab.epa.gov> <3708D83E.BBE87D60@appliedbiometrics.com>
Message-ID: <19990405122058.A815978@vislab.epa.gov>
X-UID: 528                                                  

Christian Tismer:
 |>    self.draw = Canvas(self, width="5i", height="5i",
 |>                       background="white",
 |>                       scrollregion=(0, 0, "20i", "20i"))
 |>    self.draw.scrollX = Scrollbar(self, orient=HORIZONTAL)
 |>    self.draw.scrollY = Scrollbar(self, orient=VERTICAL)
 |>         ^^^^^^^^^^^^
 |
 |This is since the self.draw is assigned a Canvas instance
 |which is itself an object with attributes.

Thanks to all who replied.  

I was foiled by "print self.draw" printing something that looked like a
primitive string type (the Tk widget name), and so I didn't think it was a
class and thus couldn't have attributes.  

I'll not forget __str__/__repr__ so easily next time. :-)

Thanks,

Randall





