!
!
!  This example demonstrates use of PetscDrawZoom()
!
!          This function is called repeatedly by PetscDrawZoom() to
!      redraw the figure
!
      subroutine zoomfunction(draw, dummy, ierr)
#include <petsc/finclude/petscsys.h>
#include <petsc/finclude/petscdraw.h>
        use petscsys
        use petscdraw
        implicit none

        PetscReal zero, one, value, max
        PetscDraw draw
        integer dummy
        PetscErrorCode ierr

        PetscInt32 i

        zero = 0
        one = 1
        max = 256.0
        do 10, i = 0, 255
          value = i/max
          PetscCall(PetscDrawLine(draw, zero, value, one, value, i, ierr))
10        continue
        end

        program main
          use petscsys
          use petscdraw
          implicit none

          PetscDraw draw
          PetscErrorCode ierr
          integer4 x, y, width, height
          External zoomfunction
          x = 0
          y = 0
          width = 256
          height = 256

          PetscCallA(PetscInitialize(ierr))
          PetscCallA(PetscDrawCreate(PETSC_COMM_WORLD, PETSC_NULL_CHARACTER, 'Title', x, y, width, height, draw, ierr))
          PetscCallA(PetscDrawSetFromOptions(draw, ierr))
          PetscCallA(PetscDrawZoom(draw, zoomfunction, PETSC_NULL_INTEGER, ierr))
          PetscCallA(PetscDrawDestroy(draw, ierr))
          PetscCallA(PetscFinalize(ierr))
        end

!/*TEST
!
!   build:
!     requires: x
!
!   test:
!     output_file: output/empty.out
!
!TEST*/
