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

Abstract

Describes a graphical user interface widget that displays the fonts available with the Python programming language's Tkinter widget set.

This publication is available in Web form and also as a PDF document. Please forward any comments to tcc-doc@nmt.edu.

Table of Contents

1. Introduction
2. Controls in the FontSelect widget
2.1. Design notes
3. Using the FontSelect widget in your Tkinter application
4. fontselector: A small test driver
4.1. The Application class
4.2. Application.__init__(): Constructor
4.3. Application.__createWidgets(): Widget layout
4.4. Application.__callback(): Observer function
4.5. Main program
5. fontselect.py: The module
5.1. class FontSelect
5.2. FontSelect.__init__(): Constructor
5.3. FontSelect.__createWidgets(): Widget placement
5.4. FontSelect.__familyHandler(): Callback for family changes
5.5. FontSelect.__controlHandler(): Callback for any font change
5.6. FontSelect.get(): Return the current font
5.7. FontSelect.getName(): Return the current font name
5.8. FontSelect.addObserver(): Register a callback
6. class FamilyPicker: Widgets for selecting the font family
6.1. FamilyPicker.__init__(): Constructor
6.2. FamilyPicker.__listboxHandler()
7. class Controls: Controls frame
7.1. Controls.__init__(): Constructor
7.2. Controls.__createWidgets()
7.3. Controls.__createButtons(): Lay out the small controls frame
7.4. Controls.__setFont(): Font change handler
7.5. Controls.setFamily(): Change font family name
7.6. Controls.getName(): Get the current font name
7.7. Controls.getFont(): Return the current font

1. Introduction

This document describes a graphical user interface widget that allows the user to select a particular text font. This widget works with the Tkinter graphical user interface for the Python programming language.

The document also contains the actual code of the widget, explained in a lightweight literate programming style.

Relevant documents:

Files extracted from this document: