July 20, 1998; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.
Usage: gxplor [-s] [window options]
gxplor is an interactive explorer for experimenting with Icon's
graphics facilities. Commands read from standard input set window
attributes or invoke procedures. Result values are reported on
standard output. Errors are caught when possible.
Here's an example, with commentary at the side, that illustrates
some of the possibilities:
% gxplor start program; a window appears
> fg query value of "fg" attribute
black
> fg blue set "fg" attribute
blue
> linewidth 7 set "linewidth" attribute
7
> drawline 12 20 55 73 a fat blue line appears
> erasearea clear window
> fillarea
[unrecognized] oops -- wrong name
> fillrectangle
> pattern query "pattern" attribute
[failed]
> pattern grid set it
grid
> fillstyle
solid
> fillstyle opaque
error 205: invalid value
> fillstyle textured set fillstyle
textured
> clip 50 50 400 200 set clipping
> fillrectangle fill clipped area with pattern
> zoom 40 40 100 100 300 50 200 200
zoom a region
> &storage query memory usage
0
274
12184
> exit exit the program
%
Input consists of blank-separated words, as shown. If the first
word is recognized as the name of an attribute, a WAttrib() call is
made. If it is an Icon keyword, the keyword value is printed.
Otherwise, the word is treated as a procedure name. Any built-in
function or linked procedure can be invoked, and procedure names are
treated as case-insensitive for ease of entry.
If a line begins with an integer, the remainder of the line is
interpreted as a command to be repeated that number of times.
Afterwards, the elapsed CPU and wall-clock time is reported;
these figures include loop and call overhead.
The -s option selects "script" mode: input is echoed on standard
output, and at EOF the program pauses in WDone().
Source code |
Program Library Page |
Icon Home Page