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

4.3. Application.__createWidgets(): Widget layout

There are only two widgets: the FontSelect widget we are testing, and a quit button below it.

fontselector
    def __createWidgets ( self ):
        """Lay out the widgets.
        """
        self.fontSelect  =  fontselect.FontSelect ( self,
            listCount=10,
            observer=self.__callback )
        self.fontSelect.grid ( row=0, column=0, padx=5, pady=5 )

        self.quitButton  =  Button ( self, text="Quit",
            font=self.buttonFont,
            command=self.quit )
        self.quitButton.grid ( row=1, column=0, columnspan=99,
            sticky=E+W, ipadx=5, ipady=5 )