Interactive Graphics

This example builds somewhat on the previous example. In addition to simply writing graphics, it uses the clgcur() procedure to return cursor coordinates to the application. Depending upon how the task is run, this is resolved in various ways. The usual situation is for the task to be run from the cl with the interactive graphics cursor activated. The user would then move the cursor and pressing a keyboard key would result in the coordinates of the cursor being returned to the task.

The clgcur() procedure is a clio function that returns a value that is EOF upon the end of cursor interaction. Note that the function call is within a while loop that terminates on the value EOF.

Note also that several cursor keys have been defined for the task. That is, when the user types that key with the graphics cursor active, the task performs some function. These functions are in addition to the built-in functions of the IRAF graphics cursor. The implementation of the cursor keys is also an example of the switch ... case syntax.

Generated with CERN WebMaker