views:

85

answers:

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

How come self.start() will call TextEditor's start if self refers to GuiMaker or else how come self refers to TextEditor?

+4  A: 

Does GuiMaker inherit from TextEditor somewhere? In other words is Frame a descendant of TextEditor? That would cause TextEditor's start method to be called.

Other than that, I don't see any way for the code (as written) to have GuiMaker.start call TextEditor.start

Jason Baker