Next / Previous / Contents / Shipman's 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 = tk.Button(self, text="Quit",
            font=self.buttonFont,
            command=self.quit)
        self.quitButton.grid(row=1, column=0, columnspan=99,
            sticky=tk.E+tk.W, ipadx=5, ipady=5)