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
pageturner.py widget do?PageTurner widgetpageturner.py moduleclass PageTurnerPageTurner.__init__(): The
constructorPageTurner.__createWidgets(): Place
internal widgetsPageTurner.__createButtons(): Create
the controlsPageTurner.__pageNoHandler():
Jump to a user-selected pagePageTurner.__prevHandler(): Go to
previous pagePageTurner.__nextHandler(): Go to
next pagePageTurner.addPage(): Add a new
content pagePageTurner.setPageNo(): Select
which page is displayedThis 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:
The application is written in Python, the author's favorite programming language. For more information, see Python 2.2 quick reference.
Tkinter is a graphical user interface for Python; for more information see Tkinter reference: A GUI for Python.
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: