Programmer's Reference

Changing graphics contexts

Several graphics context attributes can be modified at once using the changeGC:values: message. The following example creates a GC with default attributes, then changes the foreground and background colors.

| gc |
gc := CgWindow default
    createGC: None
    values: nil.
gc
    changeGC: GCForeground | GCBackground
    values:
        (CgGCValues new
            foreground: CgWindow default blackPixel;
            background: CgWindow default whitePixel).


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]