[Tutor] how to access deep classes

John jfabiani at yolo.com
Fri Nov 20 14:17:19 CET 2009


On Friday 20 November 2009 04:48:59 am Lie Ryan wrote:
> Is this what you want?
>
> class C(B):
>      @property
>      def wxpanelFontSize(self):
>          return self.pages.wxpanelFontSize
>      @wxpanelFontSize.setter
>      def wxpanelFontSize(self, value):
>          self.pages.wxpanelFontSize = value

Maybe? @property is called a decorator.  But from what I'm reading I don't see 
how it's different from what a normal property def is like:
wxpanelFontSize = property(_getwxpanelFontSize, _setwxpanelFontSize, None, '')

I'm trying to set the font size of a text control in a class that provides no 
way to set the font size.  But in the back of my head I think all wx text 
items have FontSize.  Maybe I'm thinking about this incorrectly.  I think 
your saying that from class C I can set the font size if I have access to the 
underlying wx text control.  

Johnf



More information about the Tutor mailing list