wCreateGCtx, pmCreateGCtx, et al

Drawing attributes

Types

wCreateGCtx :: (Show b, FontGen b, FudgetIO e, Show a, ColorGen a) => GCtx -> [GCAttributes a b] -> (GCtx -> e c d) -> e c d
pmCreateGCtx :: (Show b, FontGen b, FudgetIO e, Show a, ColorGen a) => PixmapId -> GCtx -> [GCAttributes a b] -> (GCtx -> e c d) -> e c d
data GCtx = GC GCId FontData
  instance Show GCtx
rootGCtx :: GCtx
createGCtx :: (Show b, FontGen b, FudgetIO e, Show a, ColorGen a) => Drawable -> GCtx -> [GCAttributes a b] -> (GCtx -> e c d) -> e c d
gcFgA :: a -> [GCAttributes a FontSpec]
gcBgA :: a -> [GCAttributes a FontSpec]
gcFontA :: a -> [GCAttributes ColorSpec a]
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 a b]
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.