Keywords: gildas-prog

Next: Plot Structuration and multi-window Up: GTV Programming Manual Previous: Programming Contents Index

# Basic Sequence

GREG and the GTVIRT are intimately related, and it is not recommended to use the GTVIRT without GREGAccordingly, the programming example given below also uses some (primitive) GREG subroutines. The basic drawing sequence is

            CALL GR_SEGM (Segment_Name,Error)   ! 1
            CALL GTPOLYL (N,Xarray,Yarray)      ! 2
            CALL ...                            ! 3
            CALL GTVIEW('Append')               ! 4

1. Open a new graphic segment. This routines is an ``intelligent'' routine checking wether pen attributes have been changed, and calling both `GTSEGM` (the basic segment creation routine) and `GTEDIT` (which defines the segment attributes like pen colour, dashed pattern, thickness).
2. Use any drawing routine you wish, e.g. an polyline. The drawing commands go to the internal metacode only at that time.
3. ...
4. Update the graphic screen with all the new drawing commands which have been put in the metacode since last call to `GTVIEW('Append')`

Further buffering between graphic segments can be obtained by enclosing a set of complete sequences like the above one between a call to `GTVIEW('Sleep')` and `GTVIEW('Wake_up')`. Drawing to the screen will then only happen when the call to `GTVIEW('Wake_up')` is made. For compatibility with other subroutines which may also perform their own `Sleep / Wake_up` control, it is recommended to use the logical function `GTSTAT` instead, e.g.

          SLEEP = GTSTAT ('Sleep')

            ... calls to GTVIRT ...

          IF (.NOT.SLEEP) CALL GTVIEW('Wake_up')

Next: Plot Structuration and multi-window Up: GTV Programming Manual Previous: Programming Contents Index