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

Abstract

Describes a graphical user interface widget that combines a list box and scroll bars, for 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. Layout of the ScrolledList widget
3. Using a ScrolledList widget in your Tkinter application
3.1. Public attributes of a ScrolledList
3.2. Methods on a ScrolledList
4. scrolledlisttest: A small test driver
4.1. The Application class
4.2. Application.__init__(): Constructor
4.3. Application.__createWidgets(): Widget layout
4.4. Application.__pickHandler(): Handler for clicking on the listbox
4.5. Application.__tests__(): Run initial tests
4.6. Main program
5. The ScrolledList module
5.1. Module prologue
5.2. class ScrolledList
5.3. ScrolledList.__init__(): Constructor
5.4. ScrolledList.__createWidgets(): Lay out internal widgets
5.5. ScrolledList.__clickHandler(): Event handler for button 1
5.6. ScrolledList.count(): Return the line count
5.7. ScrolledList.__getitem__(): Implement the Python index operator
5.8. ScrolledList.append(): Add a line of text
5.9. ScrolledList.insert(): Insert a line of text
5.10. ScrolledList.delete(): Remove a line of text
5.11. ScrolledList.clear(): Empty the listbox

1. Introduction

This document describes the usage and implementation of a graphical user interface widget called a ScrolledList, whose purpose is to display a list of lines of text. This widget combines a listbox with one or more scrollbars, so the user can use the scrollbars to see all the text even if it doesn't all fit in the available screen space.

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, along with a small test driver script named scrolledlisttest.

Relevant documents:

Files generated from this document are available online: