Next / Previous / Contents / Shipman's homepage

11. PageTurner.__prevHandler(): Go to previous page

This handler is called when the user presses the “Previous page” button. Because it is connected to the widget using the “command=” argument to the Button constructor, it is not passed an Event object like the .__pageNoHandler() method.

pageturner.py
# - - -   P a g e T u r n e r . _ _ p r e v H a n d l e r   - - -

    def __prevHandler ( self ):
        """Handle the 'Previous page' button.

          [ if self.__pageNo > 1 ->
              self  :=  self displaying page (self.__pageNo-1)
            else -> I ]
        """
        if  self.__pageNo > 1:
            self.setPageNo ( self.__pageNo - 1 )