Graphics contexts (GCs)

As we have seen in pxl-bas-graf, the look of drawings is determined by attaching graphics attributes to a drawable. It is often desirable to have various drawables use the same list of attributes. ProXL provides a data structure called graphics context (GC) to handle this situation.

To determine a figure's properties, an application can attach a list of attributes to each drawable. Alternatively, the application can create a GC, and specify the desired parameters there. Accordingly, there are two versions of each drawing primitive:

These two approaches can be freely intermixed, and used with great power and flexibility, as explained in pxl-graf-cre-use.