1
class GuiMaker(Frame):
#more code
def __init__(self, parent=None):
Frame.__init__(self, parent)
self.pack(expand=YES, fill=BOTH) # make frame stretchable
self.start() # for subclass: set menu/toolBar
self.makeMenuBar() # done here: build menu-bar
self.makeToolBar() # done here: build tool-bar
self.makeWidgets() # for subclass: add middle part
#more code
class TextEditor:
#more code
def start(self):
#more code
如何self.start()將調用TextEditor的開始,如果self引用GuiMaker或自我如何引用TextEditor?你怎麼知道兩個物體何時可以通信?
您可以隨時使用print語句或PDB斷點,看看什麼是真正被調用。 – smci 2011-07-01 06:56:12