(self, args)
VIEW: Set/unset the graphics viewport and optionally draw a box.
VIEW: Set/unset the graphics viewport and optionally draw a box.
VIEW : Set / unset the graphics viewport and optionally draw a box .
def view_(self, args):
        """VIEW: Set/unset the graphics viewport and optionally draw a box."""
        if self._mode.is_text_mode:
            raise error.BASICError(error.IFC)
        # VIEW SCREEN
        absolute = next(args)
        bounds = [
            values.to_int(_arg)
            for _arg in islice(args, 4)
        ]
        if not bounds:
            # VIEW SCREEN is a syntax error; just VIEW is OK
            error.throw_if(absolute, error.STX)
            return self._unset_view()
        x0, y0, x1, y1 = bounds
        error.range_check(0, self._mode.pixel_width-1, x0, x1)
        error.range_check(0, self._mode.pixel_height-1, y0, y1)
        error.throw_if(x0==x1 or y0 == y1)
        fill = next(args)
        if fill is not None:
            fill = values.to_int(fill)
        border = next(args)
        if border is not None:
            border = values.to_int(border)
        error.range_check(0, 255, fill)
        error.range_check(0, 255, border)
        list(args)
        self._set_view(x0, y0, x1, y1, absolute, fill, border)
def view_ ( self , args ) : if self . _mode . is_text_mode : raise error . BASICError ( error . IFC ) # VIEW SCREEN absolute = next ( args ) bounds = [ values . to_int ( _arg ) for _arg in islice ( args , 4 ) ] if not bounds : # VIEW SCREEN is a syntax error; just VIEW is OK error . throw_if ( absolute , error . STX ) return self . _unset_view ( ) x0 , y0 , x1 , y1 = bounds error . range_check ( 0 , self . _mode . pixel_width - 1 , x0 , x1 ) error . range_check ( 0 , self . _mode . pixel_height - 1 , y0 , y1 ) error . throw_if ( x0 == x1 or y0 == y1 ) fill = next ( args ) if fill is not None : fill = values . to_int ( fill ) border = next ( args ) if border is not None : border = values . to_int ( border ) error . range_check ( 0 , 255 , fill ) error . range_check ( 0 , 255 , border ) list ( args ) self . _set_view ( x0 , y0 , x1 , y1 , absolute , fill , border )