[python-nl] Classes in andere modules

Frank Niessink frank at niessink.com
Thu Feb 2 22:43:02 CET 2006


Math schreef:
>  
> class clsMDIChildFrame(wx.MDIChildFrame):
> *    def __close(self, event):
>         # clear MDIchildFrame atttribute from parent.....and close
>         module1.MainApp.MDIParentFrame.MDIChildFrame = None*
> ** 
> *        self.Destroy()

In aanvulling op de discussie over circulaire imports een wxPython 
specifieke suggestie: ik denk dat je module1.MainApp.MDI... kunt 
vervangen door wx.GetApp().MDIParentFrame... Dan hoef je module 1 
helemaal niet te importeren en kun je toch bij je MainApp komen.

Groet, Frank


More information about the Python-nl mailing list