Value mask | Value expected | Default value | |
GCForeground specifies the foreground drawing color | Integer pixel value (index of color in colormap) | 0 | |
GCBackground specifies the background drawing color | Integer pixel value (index of color in colormap) | 1 | |
GCLineWidth specifies the thickness of the drawing line | Integer value of line width in pixels | 1 pixel | |
GCLineStyle specifies how a line should be drawn. Dash pattern is specified using a dash list (see "dashes" below) | LineSolid (foreground color) LineOnOffDash (foreground color) LineDoubleDash (fore- and background color) | LineSolid | |
GCCapStyle specifies how a line should be ended | CapNotLast CapButt CapRound CapProjecting | CapButt | |
CGJoinStyle specifies how two lines should be joined | JoinMiter JoinRound JoinBevel | JoinMiter | |
GCFillStyle specifies how to fill an object such as an arc, rectangle, or polygon | FillSolid (foreground color) FillStippled (foreground color) FillOpaqueStippled (fore- and background colors) FillTiled (a multicolored pixmap) | FillSolid | |
GCFillRule specifies how a polygon should be drawn when it intersects itself | EvenOddRule (hollow where areas intersect) WindingRule (solid where areas intersect) | EvenOddRule | |
GCArcMode specifies how an arc should be drawn. To fill an arc, the GCFillStyle would also have to be set correctly. | ArcChord (connects start and end points directly) ArcPieslice (connects start and end points through the arc center point) | ArcChord | |
GCFunction specifies the raster operation to be used | GXcopy (draws shape directly from source) GXhighlight (draws shape, replacing foreground with background and vice-versa. Drawing the same shape again will restore drawable to previous state) | GXcopy | |
GCFont specifies the font to be used in text drawing operations | A CgFont | Standard system font | |
GCSubwindowMode specifies whether drawing in a parent window is clipped by or draws over child windows | ClipByChildren (allows drawing only in the parent window; child windows are not affected) IncludeInferiors (child boundaries are ignored; drawing in the parent window will draw over child windows) | ClipByChildren | |
GCTileStripXOrigin specifies the x offset of the tile or stipple pattern allowing you to position the pattern evenly | Integer value | 0 | |
GCTileStipYOrigin specifies the y offset of the stipple or tile pattern allowing you to position the pattern evenly | Integer value | 0 | |
GCClipXOrigin | x integer coordinate for clipping | 0 | |
GCClipYOrigin | y integer coordinate for clipping | 0 | |
GCClipMask specifies the CgPixmap used as a clipping mask | A CgPixmap of depth 1, or nil | nil | |
GCDashOffset specifies in pixels where to begin within a dash pattern | Integer value | 0 | |
tile specifies a CgPixmap to be used as a multiplane, multicolor fill pattern | A CgPixmap of the same depth as the drawable | A tile CgPixmap containing all zeros | |
stipple specifies a CgPixmap to be used as a 1-plane, 2-color fill pattern | A CgPixmap of depth 1 | A stipple CgPixmap containing all ones | |
dashes specifies the lengths of segments in the dash list | Array of integers specifying the length of each dash in number of pixels | #(4 4) |
Method | Values modified | Example |
setBackground: | Background color | gc setBackground: CgWindow default whitePixel |
setDashes: dashList: | Dash offset and pattern | gc setDashes: 0 dashList: #(100 20) |
setForeground: | Foreground color | gc setForeground: CgWindow default blackPixel |
setFunction: | Raster operation | gc setFunction: GXhighlight |
setLineAttributes: lineStyle: capStyle: joinStyle: | Width, style, endcap style, and join style of a line, all at once | gc setLineAttributes: 2 lineStyle: LineOnOffDash capStyle: CapButt joinStyle: JoinMiter |
setState: background: function: planeMask: | Foreground and background colors, the raster operation function, and the planeMask all at once | gc setState: CgWindow default blackPixel background: CgWindow default whitePixel function: GXcopy planeMask: nil |