<HTML
><HEAD
><TITLE
>Graphics contexts</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK
REL="HOME"
TITLE="Gnome Developers' Information"
HREF="book1.html"><LINK
REL="UP"
TITLE="Basic X concepts"
HREF="x-concepts-docs.html"><LINK
REL="PREVIOUS"
TITLE="Visuals"
HREF="visuals.html"><LINK
REL="NEXT"
TITLE="Event-driven programming"
HREF="event-driven-programming.html"></HEAD
><BODY
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Gnome Developers' Information</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="visuals.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 10. Basic X concepts</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="event-driven-programming.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="GRAPHICS-CONTEXTS"
>Graphics contexts</A
></H1
><P
>	Graphics contexts (GCs) are used in most window systems to hold
	the information about what attributes to use when drawing stuff.
	Let us say that we want to draw a line to the screen.  It would
	be cumbersome to have to specify line style, dash pattern,
	thickness, drawing color, graphics operation, and such every
	time we wanted to draw a line to the screen.  The solution is to
	have a record structure which holds this information, and to
	pass that structure to the functions that draw graphics
	primitives.  Since you often want to paint groups of primitives
	with the same attributes (color, line style, font, etc.), GCs
	are an easy and convenient way to specify these values.
      </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="visuals.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="event-driven-programming.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Visuals</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="x-concepts-docs.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Event-driven programming</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>