ยค wCreateGCtx, pmCreateGCtx, et al

Drawing attributes

Types

wCreateGCtx :: (ColorGen a1, FudgetIO f, FontGen a2, Show a1, Show a2) =>
               GCtx -> [GCAttributes a1 a2] -> (GCtx -> f i o) -> f i o
pmCreateGCtx :: (ColorGen a1, FudgetIO f, FontGen a2, Show a1, Show a2) =>
                PixmapId -> GCtx -> [GCAttributes a1 a2] -> (GCtx -> f i o) -> f i o
data GCtx = GC GCId FontData
instance Show GCtx

rootGCtx :: GCtx
createGCtx :: (ColorGen a1, FudgetIO f, FontGen a2, Show a1, Show a2) =>
              Drawable -> GCtx -> [GCAttributes a1 a2] -> (GCtx -> f i o) -> f i o
gcFgA :: c -> [GCAttributes c FontSpec]
gcBgA :: c -> [GCAttributes c FontSpec]
gcFontA :: f -> [GCAttributes ColorSpec f]
gctx2gc :: GCtx -> GCId

Synopsis

wCreateGCtx templgc gcattrs

Description

Values of type GCtx contain a GCId and the FontStruct of the font used by the GC.

GCtxs are used by the rendering system for Drawings. For efficiency, rather than embedding drawing attributes (e.g., color and font names) in drawings, an appropriate GCtx can be created in advance and included in the drawing.

wCreateGCtx creates a new GCtx by modifying a template GCtx. rootGCtx can be used as a template, but should not be used for any other purpose.

Since GCattributes is parameterized over the types of colors and fonts and wCreateGCtx is overloaded in these types, you get ambiguous overloadings for gc attribute lists that don't specify both a color and a font. The general way out of this is to use a type restriction to specify a type for the missing attributes. A convenient solution for some common cases is provided by the functions gcFgA, gcBgA and gcFontA.

Arguments

templgc :: GCtx
a template GCtx.

gcattrs :: [GCAttributes a1 a2]
The GC attributes where the GCtx to be created should differ from the template. If you don't specify both a color and a font, you will get an ambiguous overloading (see above).

See Also

Similar functions for plain GCs: wCreateGC et al.

Data type for composite graphics: Drawing.

Bugs

Incomplete documentation.

This page documents work progress. Information on this page is subject to change without notice and does not represent a commitment on the part of the Fudgets corporation.