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

Abstract

Describes a graphical user interface widget that allows the selection of one of a set of pages, using the Python programming language and the 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. What does the pageturner.py widget do?
2. General layout
3. How to use a PageTurner widget
4. Design decisions
4.1. How it works
4.2. Limitations
5. Prologue to the pageturner.py module
6. class PageTurner
7. PageTurner.__init__(): The constructor
8. PageTurner.__createWidgets(): Place internal widgets
9. PageTurner.__createButtons(): Create the controls
10. PageTurner.__pageNoHandler(): Jump to a user-selected page
11. PageTurner.__prevHandler(): Go to previous page
12. PageTurner.__nextHandler(): Go to next page
13. PageTurner.addPage(): Add a new content page
14. PageTurner.setPageNo(): Select which page is displayed
15. A small test driver

1. What does the pageturner.py widget do?

This document describes a widget that can be included in a GUI (graphical user interface) application to present one of a set of multiple pages in a frame. The user is presented with “Next” and “Previous” buttons that allow them to page forward and backward through the page set. Pages can also be changed under program control.

This document assumes that the reader is familiar with these tools:

This document describes the external interface to the pageturner.py widget. It also contains the code for the widget, in literate programming style: for more on literate programming, see A source extractor for lightweight literate programming. The code was developed using the Cleanroom or zero-defect style; for the author's practice and conventions, see The cleanroom software development methodology.

Relevant online files: