(self, new_vpagenum, new_apagenum)
Set active page & visible page, counting from 0.
Set active page & visible page, counting from 0.
Set active page & visible page counting from 0 .
def set_page(self, new_vpagenum, new_apagenum):
        """Set active page & visible page, counting from 0."""
        if new_vpagenum is None:
            new_vpagenum = self.vpagenum
        if new_apagenum is None:
            new_apagenum = self.apagenum
        if (new_vpagenum >= self.mode.num_pages or new_apagenum >= self.mode.num_pages):
            raise error.BASICError(error.IFC)
        try:
            self.pages[self.vpagenum].set_visible(False)
        except IndexError:
            # the page has been discarded, no need to set it invisible
            pass
        self.pages[new_vpagenum].set_visible(True)
        self.vpagenum = new_vpagenum
        self.apagenum = new_apagenum
        self.graphics.set_page(new_apagenum)
        self.text_screen.set_page(new_vpagenum, new_apagenum)
def set_page ( self , new_vpagenum , new_apagenum ) : if new_vpagenum is None : new_vpagenum = self . vpagenum if new_apagenum is None : new_apagenum = self . apagenum if ( new_vpagenum >= self . mode . num_pages or new_apagenum >= self . mode . num_pages ) : raise error . BASICError ( error . IFC ) try : self . pages [ self . vpagenum ] . set_visible ( False ) except IndexError : # the page has been discarded, no need to set it invisible pass self . pages [ new_vpagenum ] . set_visible ( True ) self . vpagenum = new_vpagenum self . apagenum = new_apagenum self . graphics . set_page ( new_apagenum ) self . text_screen . set_page ( new_vpagenum , new_apagenum )