bend or redirect a class method and then call it again

Francesco scrutinizer at gmx.at
Thu Jul 22 15:23:06 EDT 2004


On Thu, 22 Jul 2004 10:58:33 -0700, Jeff Shannon <jeff at ccvcorp.com>
wrote:

>>[#drFrame is inherited from wx.Frame]
>>[#in drFrame there are some calls to SetStatusText]

I think, I don't make it clear enough.

in drFrame there are some calls to SetStatusText.
these, I want catch, change some strings, and send it back; 
simply said.

>What's the point of this extra 'NewStatusText' method?  You're already 
>overriding SetStatusText.  Without the NewStatusText and the setattr() 
>call, when someone calls SomePluginObject.SetStatusText(), it will call 
>your new version rather than the wx.Frame (or DrFrame) version 


but not from drFrame itself; that is the point.

I want:
ALL the calls SetStatusText IN DRFRAME itself should be processed.

>-- that's 
>the whole point of inheritance.  (This is true even when the 'someone' 
>is the object itself, from within the DrFrame base class.  The *only* 
>way to get the base class version(s) is by explicitly asking for it.)  
>The extra method and setattr() don't seem to be gaining you anything. 

these calls (in drFrame), I want to "trick", to go further down one
level, or better said redirect to my own function, change the text, 
and use the normal SetStatusText from wx.Frame. 


Anyway, thank you.
-- 
Francesco



More information about the Python-list mailing list