Next / Previous / Contents / TCC Help System / NM Tech homepage

4.2. Application.__init__(): Constructor

The constructor is quite pro forma: call the parent class constructor, register the application with its .grid() method, create a font, create the widgets, and wait in the main loop.

fontselector
    def __init__ ( self ):
        """Constructor for the Application class.
        """
        Frame.__init__ ( self, None )
        self.buttonFont = tkFont.Font ( family="Helvetica", size=20 )
        self.grid ( padx=5, pady=5 )
        self.__createWidgets()