Graphics Attributes and Graphics Contexts

The X window system requires one to set up many parameters to drawing commands before using the drawing primitives. For example, the command to draw a line in X does not have a way to specify the width of the line, or whether it will be dashed. These parameters must be specified ahead of time. Fortunately, there are defaults for all of these parameters, as discussed below, so you only need to worry about the parameters whose defaults don't suit you.

In ProXL, there are two ways to do this. You may specify the drawing parameters for the object you are drawing into, or you may specify them in a separate data structure, called a graphics context, or gc, and give the gc as an argument to the drawing commands. You may do whichever is more convenient at the time. You may mix these methods as you like.