#!/usr/bin/env python #================================================================ # pageturnertest: Test driver for the PageTurner widget. # Do not edit this file. It is extracted automatically from its # documentation file. See: # http://www.nmt.edu/tcc/help/lang/python/examples/pageturner/ #---------------------------------------------------------------- from Tkinter import * from pageturner import * # - - - - - c l a s s A p p l i c a t i o n - - - - - class Application(Frame): # - - - A p p l i c a t i o n . _ _ i n i t _ _ - - - def __init__ ( self, master=None ): Frame.__init__(self, master) self.grid() self.__createWidgets() # - - - A p p l i c a t i o n . _ _ c r e a t e W i d g e t s - - - def __createWidgets(self): """Place all widgets in self.""" self.pager = PageTurner ( self, size=(500,300) ) self.pager.grid ( row=0, column=0 ) self.quitButton = Button ( self, text="Quit", command=self.quit ) self.quitButton.grid ( row=99, column=0, columnspan=99, sticky=E+W ) for i in range(1,9): content = Frame ( self.pager.bodyFrame ) lab = Label ( content, text="This is page %d." % i ) lab.grid(row=0, column=0, sticky=NW) self.pager.addPage ( content ) # - - - - - m a i n - - - - - app = Application() app.master.title ( "pageturnertest" ) app.mainloop()