<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-gdkgc">
  <refnamediv>
    <refname>gtk.gdk.GC</refname>
    <refpurpose>objects to encapsulate drawing properties.</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.gdk.GC</classname></ooclass>
      <ooclass><classname><link
linkend="class-gobject">gobject.GObject</link></classname></ooclass>
      <constructorsynopsis language="python">
        <methodname><link
linkend="constructor-gdkgc">gtk.gdk.GC</link></methodname>
        <methodparam><parameter
                       role="keyword">drawable</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">foreground</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">background</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">font</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">function</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">fill</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">tile</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">stipple</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">clip_mask</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">subwindow_mode</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">ts_x_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">ts_y_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">clip_x_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">clip_y_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">graphics_exposures</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">line_width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">line_style</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">cap_style</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">join_style</parameter>></methodparam>
      </constructorsynopsis>

<!-- NOT IMPLEMENTED
<methodsynopsis language="python">
    <methodname><link linkend="method-gdkgc- -get-values">get_values</link></methodname>
    <methodparam><parameter role="keyword">values</parameter></methodparam>
  </methodsynopsis>
END NOT IMPLEMENTED -->

      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-values">set_values</link></methodname>
	<methodparam><parameter
		       role="keyword">foreground</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">background</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">font</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">function</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">fill</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">tile</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">stipple</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">clip_mask</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">subwindow_mode</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">ts_x_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">ts_y_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">clip_x_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">clip_y_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">graphics_exposures</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">line_width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">line_style</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">cap_style</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">join_style</parameter>></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-foreground">set_foreground</link></methodname>
	<methodparam><parameter
		       role="keyword">color</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-background">set_background</link></methodname>
	<methodparam><parameter
		       role="keyword">color</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-function">set_function</link></methodname>
	<methodparam><parameter
		       role="keyword">function</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-fill">set_fill</link></methodname>
	<methodparam><parameter
		       role="keyword">fill</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-tile">set_tile</link></methodname>
	<methodparam><parameter
		       role="keyword">tile</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-stipple">set_stipple</link></methodname>
	<methodparam><parameter
		       role="keyword">stipple</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-ts-origin">set_ts_origin</link></methodname>
	<methodparam><parameter role="keyword">x</parameter></methodparam>
	<methodparam><parameter role="keyword">y</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-clip-origin">set_clip_origin</link></methodname>
	<methodparam><parameter role="keyword">x</parameter></methodparam>
	<methodparam><parameter role="keyword">y</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-clip-mask">set_clip_mask</link></methodname>
	<methodparam><parameter
		       role="keyword">mask</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-clip-rectangle">set_clip_rectangle</link></methodname>
	<methodparam><parameter
		       role="keyword">rectangle</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gdkgc--set-clip-region">set_clip_region</link></methodname>
        <methodparam><parameter role="keyword">region</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-subwindow">set_subwindow</link></methodname>
	<methodparam><parameter
		       role="keyword">mode</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-exposures">set_exposures</link></methodname>
	<methodparam><parameter
		       role="keyword">exposures</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-line-attributes">set_line_attributes</link></methodname>
	<methodparam><parameter
		       role="keyword">line_width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">line_style</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">cap_style</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">join_style</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-dashes">set_dashes</link></methodname>
	<methodparam><parameter>dash_offset</parameter></methodparam>
	<methodparam><parameter>dash_list</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--offset">offset</link></methodname>
	<methodparam><parameter
		       role="keyword">x_offset</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">y_offset</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--copy">copy</link></methodname>
	<methodparam><parameter
		       role="keyword">src_gc</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-colormap">set_colormap</link></methodname>
	<methodparam><parameter
		       role="keyword">colormap</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--get-colormap">get_colormap</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-rgb-fg-color">set_rgb_fg_color</link></methodname>
	<methodparam><parameter
		       role="keyword">color</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkgc--set-rgb-bg-color">set_rgb_bg_color</link></methodname>
	<methodparam><parameter
		       role="keyword">color</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gdkgc--get-screen">get_screen</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gdkgc">gtk.gdk.GC</link>
</synopsis>

  </refsect1>

  <refsect1>
    <title>Attributes</title>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	<?dbhtml cellpadding="5"?>
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"background"</entry>
	      <entry>Read-Write</entry>
	      <entry>The background <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"cap_style"</entry>
	      <entry>Read-Write</entry>
	      <entry>The style of drawing the ends of lines - one of:
<literal>gtk.gdk.CAP_NOT_LAST</literal>,
<literal>gtk.gdk.CAP_BUTT</literal>, <literal>gtk.gdk.CAP_ROUND</literal> or
<literal>gtk.gdk.CAP_PROJECTING</literal>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"clip_mask"</entry>
	      <entry>Read-Write</entry>
	      <entry>A <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link>
bitmap used to clip the drawing operation.</entry>
	    </row>

	    <row valign="top">
	      <entry>"clip_x_origin"</entry>
	      <entry>Read-Write</entry>
	      <entry>The x origin of the clip mask.</entry>
	    </row>

	    <row valign="top">
	      <entry>"clip_y_origin"</entry>
	      <entry>Read-Write</entry>
	      <entry>The y origin of the clip mask.</entry>
	    </row>

	    <row valign="top">
	      <entry>"fill"</entry>
	      <entry>Read-Write</entry>
	      <entry>The fill style - one of:
<literal>gtk.gdk.SOLID</literal>, <literal>gtk.gdk.TILED</literal>,
<literal>gtk.gdk.STIPPLED</literal> or
<literal>gtk.gdk.OPAQUE_STIPPLED</literal>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"font"</entry>
	      <entry>Read-Write</entry>
	      <entry>The default font (deprecated and unused)</entry>
	    </row>

	    <row valign="top">
	      <entry>"foreground"</entry>
	      <entry>Read-Write</entry>
	      <entry>The foreground <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"function"</entry>
	      <entry>Read-Write</entry>
	      <entry>A bitwise operation type to combine source and
destination pixels - one of: <literal>gtk.gdk.COPY</literal>,
<literal>gtk.gdk.INVERT</literal>, <literal>gtk.gdk.XOR</literal>,
<literal>gtk.gdk.CLEAR</literal>, <literal>gtk.gdk.AND</literal>,
<literal>gtk.gdk.AND_REVERSE</literal>,
<literal>gtk.gdk.AND_INVERT</literal>, <literal>gtk.gdk.NOOP</literal>,
<literal>gtk.gdk.OR</literal>, <literal>gtk.gdk.EQUIV</literal>,
<literal>gtk.gdk.OR_REVERSE</literal>,
<literal>gtk.gdk.COPY_INVERT</literal>,
<literal>gtk.gdk.OR_INVERT</literal>, <literal>gtk.gdk.NAND</literal>,
<literal>gtk.gdk.NOR</literal> or <literal>gtk.gdk.SET</literal>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"graphics_exposures"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal> graphics exposures are
enabled.</entry>
	    </row>

	    <row valign="top">
	      <entry>"join_style"</entry>
	      <entry>Read-Write</entry>
	      <entry>The style used to join lines - one of:
<literal>gtk.gdk.JOIN_MITER</literal>, <literal>gtk.gdk.JOIN_ROUND</literal>
or <literal>gtk.gdk.JOIN_BEVEL</literal>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"line_style"</entry>
	      <entry>Read-Write</entry>
	      <entry>The style of drawing lines - one of:
<literal>gtk.gdk.LINE_SOLID</literal>,
<literal>gtk.gdk.LINE_ON_OFF_DASH</literal> or
<literal>gtk.gdk.LINE_DOUBLE_DASH</literal>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"line_width"</entry>
	      <entry>Read-Write</entry>
	      <entry>The width of a line in pixels.</entry>
	    </row>

	    <row valign="top">
	      <entry>"stipple"</entry>
	      <entry>Read-Write</entry>
	      <entry>The <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link>
bitmap used to stipple the background.</entry>
	    </row>

	    <row valign="top">
	      <entry>"sub_window"</entry>
	      <entry>Read-Write</entry>
	      <entry>The mode of drawing in a <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> with
subwindows - one of: <literal>gtk.gdk.CLIP_BY_CHILDREN</literal> or
<literal>gtk.gdk.INCLUDE_INFERIORS</literal>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"tile"</entry>
	      <entry>Read-Write</entry>
	      <entry>The <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> used
to tile the background.</entry>
	    </row>

	    <row valign="top">
	      <entry>"ts_x_origin"</entry>
	      <entry>Read-Write</entry>
	      <entry>The x origin of the tile or stipple.</entry>
	    </row>

	    <row valign="top">
	      <entry>"ts_y_origin"</entry>
	      <entry>Read-Write</entry>
	      <entry>The y origin of the tile or stipple.</entry>
	    </row>

	  </tbody>
	</tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>All drawing operations in <literal>PyGTK</literal> take a graphics
context (<link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link>) argument
(See the <link
linkend="class-gdkdrawable"><classname>gtk.gdk.Drawable</classname></link>
description). A graphics context encapsulates information about the way
things are drawn, such as the foreground color or line width. By using
graphics contexts, the number of arguments to each drawing call is greatly
reduced, and communication overhead is minimized, since identical arguments
do not need to be passed repeatedly. Most values of a graphics context can
be set at creation time by using <link
linkend="method-gdkdrawable--new-gc"><methodname>gtk.gdk.Drawable.new_gc</methodname>()</link>, 
or can be set one-by-one using functions such as <link
linkend="method-gdkgc--set-foreground"><methodname>set_foreground</methodname>()</link> 
or by setting a <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> attribute. A
few of the values in the <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link>, such as the
dash pattern, can only be set by the latter method.</para>

    <para>Note that all coordinates except for clip mask and clip region are relative to
      destination drawable (e.g. <link linkend="class-gdkwindow">gtk.gdk.Window</link>)
      origin.  In particular, coordinates are <emphasis>not</emphasis> related to widget
      allocation.</para>
  </refsect1>

 <refsect1 id="constructor-gdkgc">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
        <methodname>gtk.gdk.GC</methodname>
        <methodparam><parameter
                       role="keyword">drawable</parameter></methodparam>
 	<methodparam><parameter
		       role="keyword">foreground</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">background</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">font</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">function</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">fill</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">tile</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">stipple</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">clip_mask</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">subwindow_mode</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">ts_x_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">ts_y_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">clip_x_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">clip_y_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">graphics_exposures</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">line_width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">line_style</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">cap_style</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">join_style</parameter>></methodparam>
</constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
        <term><parameter role="keyword">drawable</parameter>&nbsp;:</term>
        <listitem><simpara>A <link
linkend="class-gdkdrawable"><classname>gtk.gdk.Drawable</classname></link>
(<link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> or
<link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link>)</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">foreground</parameter>&nbsp;:</term>
	<listitem><simpara>the foreground <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link></simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">background</parameter>&nbsp;:</term>
	<listitem><simpara>the background <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link></simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">font</parameter>&nbsp;:</term>
	<listitem><simpara>a font (deprecated and
ignored)</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">function</parameter>&nbsp;:</term>
	<listitem><simpara>the bitwise operator used to combine the existing
pixel value and a new pixel value - usually one of:
<literal>gtk.gdk.COPY</literal>, <literal>gtk.gdk.XOR</literal> or
<literal>gtk.gdk.INVERT</literal>.</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">fill</parameter>&nbsp;:</term>
	<listitem><simpara>the fill style - one of:
<literal>gtk.gdk.SOLID</literal>, <literal>gtk.gdk.TILED</literal>,
<literal>gtk.gdk.STIPPLED</literal>,
<literal>gtk.gdk.OPAQUE_STIPPLED</literal></simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">tile</parameter>&nbsp;:</term>
	<listitem><simpara>a <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> used
for tiling the background</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">stipple</parameter>&nbsp;:</term>
	<listitem><simpara>a <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> used
for stippling the background</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">clip_mask</parameter>&nbsp;:</term>
	<listitem><simpara>a <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> of
depth 1 used to mask pixels to be drawn</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter
role="keyword">subwindow_mode</parameter>&nbsp;:</term>
	<listitem><simpara>the mode of drawing on subwindows in a <link linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link>
- one of: <literal>gtk.gdk.CLIP_BY_CHILDREN</literal> or
<literal>gtk.gdk.INCLUDE_INFERIORS</literal></simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter
role="keyword">ts_x_origin</parameter>&nbsp;:</term>
	<listitem><simpara>the X coordinate of the origin of
<parameter>tile</parameter> or
<parameter>stipple</parameter></simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter
role="keyword">ts_y_origin</parameter>&nbsp;:</term>
	<listitem><simpara>the Y coordinate of the origin of
<parameter>tile</parameter> or
<parameter>stipple</parameter></simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter
role="keyword">clip_x_origin</parameter>&nbsp;:</term>
	<listitem><simpara>the X coordinate of the origin of
<parameter>clip_mask</parameter></simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter
role="keyword">clip_y_origin</parameter>&nbsp;:</term>
	<listitem><simpara>the Y coordinate of the origin of
<parameter>clip_mask</parameter></simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter
role="keyword">graphics_exposures</parameter>&nbsp;:</term>
	<listitem><simpara>if <literal>True</literal> graphics exposures are
enabled for calls to the <link
linkend="method-gdkdrawable--draw-drawable"><methodname>gtk.gdk.Drawable.draw_drawable</methodname>()</link> 
method.</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">line_width</parameter>&nbsp;:</term>
	<listitem><simpara>the line width in pixels</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">line_style</parameter>&nbsp;:</term>
	<listitem><simpara>the line style - one of:
<literal>gtk.gdk.LINE_SOLID</literal>,
<literal>gtk.gdk.LINE_ON_OFF_DASH</literal>,
<literal>gtk.gdk.LINE_DOUBLE_DASH</literal></simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">cap_style</parameter>&nbsp;:</term>
	<listitem><simpara>the style of line ends - one of:
<literal>gtk.gdk.CAP_NOT_LAST</literal>,
<literal>gtk.gdk.CAP_BUTT</literal>, <literal>gtk.gdk.CAP_ROUND</literal>,
<literal>gtk.gdk.CAP_PROJECTING</literal></simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">join_style</parameter>&nbsp;:</term>
	<listitem><simpara>the style of line joins - one of:
<literal>gtk.gdk.JOIN_MITER</literal>,
<literal>gtk.gdk.JOIN_ROUND</literal>,
<literal>gtk.gdk.JOIN_BEVEL</literal></simpara></listitem>
      </varlistentry>
      <varlistentry>
        <term><emphasis>Returns</emphasis>&nbsp;:</term>
        <listitem><simpara>a new <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link>
object</simpara></listitem>
      </varlistentry>
    </variablelist>

    <para>Creates a new <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> object for
the <link
linkend="class-gdkdrawable"><classname>gtk.gdk.Drawable</classname></link>
specified by <parameter>drawable</parameter> with the optional attributes as
specified by the arguments. The drawable parameter must be specified but the
rest of the parameters are optional. Any attributes not specified will use a
default value. This is an alternative to the <link
linkend="method-gdkdrawable--new-gc"><methodname>gtk.gdk.Drawable.new_gc</methodname>()</link> 
method. Since there are a large number of optional attribute parameters it's
probably best to specify the attribute values using keywords.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

<!-- NOT IMPLEMENTED
  <refsect2 id="method-gdkgc- -get-values">
    <title>gtk.gdk.GC.get_values</title>

<programlisting><methodsynopsis language="python">
    <methodname>get_values</methodname>
    <methodparam><parameter role="keyword">values</parameter></methodparam>
  </methodsynopsis></programlisting>
  <variablelist>
    <varlistentry>
      <term><parameter role="keyword">values</parameter>&nbsp;:</term>
      <listitem><simpara>a GdkGCValues*</simpara></listitem>
    </varlistentry>
  </variablelist>
  </refsect2>
END NOT IMPLEMENTED -->

    <refsect2 id="method-gdkgc--set-values">
      <title>gtk.gdk.GC.set_values</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_values</methodname>
	  <methodparam><parameter
			 role="keyword">values</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">foreground</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">background</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">font</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">function</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">fill</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">tile</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">stipple</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">clip_mask</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">subwindow_mode</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">ts_x_origin</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">ts_y_origin</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">clip_x_origin</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">clip_y_origin</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">graphics_exposures</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">line_width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">line_style</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">cap_style</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">join_style</parameter>></methodparam> 
</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">foreground</parameter>&nbsp;:</term>
	  <listitem><simpara>the foreground <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">background</parameter>&nbsp;:</term>
	  <listitem><simpara>the background <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">font</parameter>&nbsp;:</term>
	  <listitem><simpara>a font (deprecated and
ignored)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">function</parameter>&nbsp;:</term>
	  <listitem><simpara>the bitwise operator used to combine the
existing pixel value and a new pixel value - usually one of:
<literal>gtk.gdk.COPY</literal>, <literal>gtk.gdk.XOR</literal> or
<literal>gtk.gdk.INVERT</literal>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">fill</parameter>&nbsp;:</term>
	  <listitem><simpara>the fill style - one of:
<literal>gtk.gdk.SOLID</literal>, <literal>gtk.gdk.TILED</literal>,
<literal>gtk.gdk.STIPPLED</literal>,
<literal>gtk.gdk.OPAQUE_STIPPLED</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">tile</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> used
for tiling the background</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">stipple</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> used
for stippling the background</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">clip_mask</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> of
depth 1 used to mask pixels to be drawn</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">subwindow_mode</parameter>&nbsp;:</term>
	  <listitem><simpara>the mode of drawing on subwindows in a
<link linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> - one of: <literal>gtk.gdk.CLIP_BY_CHILDREN</literal> or
<literal>gtk.gdk.INCLUDE_INFERIORS</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">ts_x_origin</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate of the origin of
<parameter>tile</parameter> or
<parameter>stipple</parameter></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">ts_y_origin</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate of the origin of
<parameter>tile</parameter> or
<parameter>stipple</parameter></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">clip_x_origin</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate of the origin of
<parameter>clip_mask</parameter></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">clip_y_origin</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate of the origin of
<parameter>clip_mask</parameter></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">graphics_exposures</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> graphics exposures
are enabled for calls to the <link
linkend="method-gdkdrawable--draw-drawable"><methodname>gtk.gdk.Drawable.draw_drawable</methodname>()</link> 
method.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">line_width</parameter>&nbsp;:</term>
	  <listitem><simpara>the line width in pixels</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">line_style</parameter>&nbsp;:</term>
	  <listitem><simpara>the line style - one of:
<literal>gtk.gdk.LINE_SOLID</literal>,
<literal>gtk.gdk.LINE_ON_OFF_DASH</literal>,
<literal>gtk.gdk.LINE_DOUBLE_DASH</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">cap_style</parameter>&nbsp;:</term>
	  <listitem><simpara>the style of line ends - one of:
<literal>gtk.gdk.CAP_NOT_LAST</literal>,
<literal>gtk.gdk.CAP_BUTT</literal>, <literal>gtk.gdk.CAP_ROUND</literal>,
<literal>gtk.gdk.CAP_PROJECTING</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">join_style</parameter>&nbsp;:</term>
	  <listitem><simpara>the style of line joins - one of:
<literal>gtk.gdk.JOIN_MITER</literal>,
<literal>gtk.gdk.JOIN_ROUND</literal>,
<literal>gtk.gdk.JOIN_BEVEL</literal></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_values</methodname>() method sets the
attributes of a graphics context in bulk using the optional parameters.
Since there are a large number of attribute parameters it's probably best to
specify the attribute values using keywords. Any attributes not specified
will be left as is.</para>

    </refsect2>

    <refsect2 id="method-gdkgc--set-foreground">
      <title>gtk.gdk.GC.set_foreground</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_foreground</methodname>
	  <methodparam><parameter
			 role="keyword">color</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">color</parameter>&nbsp;:</term>
	  <listitem><simpara>the new foreground <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_foreground</methodname>() method sets the
foreground <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link> to the
value specified by <parameter>color</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gdkgc--set-background">
      <title>gtk.gdk.GC.set_background</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_background</methodname>
	  <methodparam><parameter
			 role="keyword">color</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">color</parameter>&nbsp;:</term>
	  <listitem><simpara>the new background <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_background</methodname>() method sets the
background <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link> to the
value specified by <parameter>color</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gdkgc--set-function">
      <title>gtk.gdk.GC.set_function</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_function</methodname>
	  <methodparam><parameter
			 role="keyword">function</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">function</parameter>&nbsp;:</term>
	  <listitem><simpara>the bitwise operator used to combine the
existing pixel value and a new pixel value - usually one of:
<literal>gtk.gdk.COPY</literal>, <literal>gtk.gdk.XOR</literal> or
<literal>gtk.gdk.INVERT</literal>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_function</methodname>() method sets the
function attribute to the value specified by
<parameter>function</parameter>. The value of
<parameter>function</parameter> must be one of:</para>

      <itemizedlist>
	<listitem>
	  <simpara><literal>gtk.gdk.COPY</literal></simpara>
	</listitem>
	<listitem>
	  <simpara><literal>gtk.gdk.INVERT</literal></simpara>
	</listitem>
	<listitem>
	  <simpara><literal>gtk.gdk.XOR</literal></simpara>
	</listitem>
	<listitem>
	  <simpara><literal>gtk.gdk.CLEAR</literal></simpara>
	</listitem>
	<listitem>
	  <simpara><literal>gtk.gdk.AND</literal></simpara>
	</listitem>
	<listitem>
	  <simpara><literal>gtk.gdk.AND_REVERSE.</literal></simpara>
	</listitem>
	<listitem>
	  <simpara><literal>gtk.gdk.AND_INVERT</literal></simpara>
	</listitem>
	<listitem>
	  <simpara><literal>gtk.gdk.NOOP</literal></simpara>
	</listitem>
	<listitem>
	  <simpara><literal>gtk.gdk.OR</literal></simpara>
	</listitem>
	<listitem>
	  <simpara><literal>gtk.gdk.EQUIV</literal></simpara>
	</listitem>
	<listitem>
	  <simpara><literal>gtk.gdk.OR_REVERSE</literal></simpara>
	</listitem>
	<listitem>
	  <simpara><literal>gtk.gdk.COPY_INVERT</literal></simpara>
	</listitem>
	<listitem>
	  <simpara><literal>gtk.gdk.OR_INVERT</literal></simpara>
	</listitem>
	<listitem>
	  <simpara><literal>gtk.gdk.NAND</literal></simpara>
	</listitem>
	<listitem>
	  <simpara><literal>gtk.gdk.NOR</literal></simpara>
	</listitem>
	<listitem>
	  <simpara><literal>gtk.gdk.SET</literal></simpara>
	</listitem>
      </itemizedlist>

      <para>Only a couple of these values are usually useful. For colored
images, only <literal>gtk.gdk.COPY</literal>, <literal>gtk.gdk.XOR</literal>
and <literal>gtk.gdk.INVERT</literal> are generally useful. For bitmaps,
<literal>gtk.gdk.AND</literal> and <literal>gtk.gdk.OR</literal> are also
useful. </para>

    </refsect2>

    <refsect2 id="method-gdkgc--set-fill">
      <title>gtk.gdk.GC.set_fill</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_fill</methodname>
	  <methodparam><parameter
			 role="keyword">fill</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">fill</parameter>&nbsp;:</term>
	  <listitem><simpara>the new fill mode</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_fill</methodname>() method sets the fill
mode for the graphics context to the value specified by
<parameter>fill</parameter>. The value of <parameter>fill</parameter> must
be one of:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gtk.gdk.SOLID</literal></term>
	  <listitem>
	    <simpara>draw with the foreground color. </simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.TILED</literal></term>
	  <listitem>
	    <simpara>draw with a tiled pixmap.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.STIPPLED</literal></term>
	  <listitem>
	    <simpara>draw using the stipple bitmap. Pixels corresponding to
bits in the stipple bitmap that are set will be drawn in the foreground
color; pixels corresponding to bits that are not set will be left
untouched.</simpara>
	  </listitem>
	</varlistentry>
 	<varlistentry>
	  <term><literal>gtk.gdk.OPAQUE_STIPPLED</literal></term>
	  <listitem>
	    <simpara>draw using the stipple bitmap. Pixels corresponding to
bits in the stipple bitmap that are set will be drawn in the foreground
color; pixels corresponding to bits that are not set will be drawn with the
background color.</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para></para>

    </refsect2>

    <refsect2 id="method-gdkgc--set-tile">
      <title>gtk.gdk.GC.set_tile</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_tile</methodname>
	  <methodparam><parameter
			 role="keyword">tile</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">tile</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_tile</methodname>() method sets the <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link>
specified by <parameter>tile</parameter> to be used for filling the
background when the fill mode is <literal>gtk.gdk.TILED</literal>.</para>

    </refsect2>

    <refsect2 id="method-gdkgc--set-stipple">
    <title>gtk.gdk.GC.set_stipple</title>

<programlisting><methodsynopsis language="python">
    <methodname>set_stipple</methodname>
    <methodparam><parameter role="keyword">stipple</parameter></methodparam>
  </methodsynopsis></programlisting>
  <variablelist>
    <varlistentry>
      <term><parameter role="keyword">stipple</parameter>&nbsp;:</term>
      <listitem><simpara>a <link linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> bitmap</simpara></listitem>
    </varlistentry>
  </variablelist>

      <para>The <methodname>set_stipple</methodname>() method sets the <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link>
bitmap specified by <parameter>stipple</parameter> to be used for stippling
the background. <parameter>stipple</parameter> will only be used if the fill
mode is <literal>gtk.gdk.STIPPLED</literal> or
<literal>gtk.gdk.OPAQUE_STIPPLED</literal>.</para>

    </refsect2>

    <refsect2 id="method-gdkgc--set-ts-origin">
      <title>gtk.gdk.GC.set_ts_origin</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_ts_origin</methodname>
	  <methodparam><parameter role="keyword">x</parameter></methodparam>
	  <methodparam><parameter role="keyword">y</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">x</parameter>&nbsp;:</term>
	  <listitem><simpara>the x origin of the tile or
stipple</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y</parameter>&nbsp;:</term>
	  <listitem><simpara>the y origin of the tile or
stipple</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_ts_origin</methodname>() method sets the
origin of the tile or stipple to the value specified by
<parameter>x</parameter> and <parameter>y</parameter>. The tile or stipple
will be aligned such that the upper left corner of the tile or stipple will
coincide with this point.</para>

    </refsect2>

  <refsect2 id="method-gdkgc--set-clip-origin">
      <title>gtk.gdk.GC.set_clip_origin</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_clip_origin</methodname>
	  <methodparam><parameter role="keyword">x</parameter></methodparam>
	  <methodparam><parameter role="keyword">y</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">x</parameter>&nbsp;:</term>
	  <listitem><simpara>the x origin of the clip
mask</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y</parameter>&nbsp;:</term>
	  <listitem><simpara>the y origin of the clip
mask</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_clip_origin</methodname>() method sets the
origin of the clip mask to the value specified by <parameter>x</parameter>
and <parameter>y</parameter>. The coordinates are interpreted relative to
the upper-left corner of the destination drawable of the current
operation.</para>

    </refsect2>

  <refsect2 id="method-gdkgc--set-clip-mask">
      <title>gtk.gdk.GC.set_clip_mask</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_clip_mask</methodname>
	  <methodparam><parameter
			 role="keyword">mask</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">mask</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
	  linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_clip_mask</methodname>() method sets the
clip mask (a <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> bit
map) to the value specified by <parameter>mask</parameter>. The clip mask is
interpreted relative to the clip origin. See the <link
linkend="method-gdkgc--set-clip-origin"><methodname>set_clip_origin</methodname>()</link>
method.</para>

    </refsect2>

    <refsect2 id="method-gdkgc--set-clip-rectangle">
      <title>gtk.gdk.GC.set_clip_rectangle</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_clip_rectangle</methodname>
	  <methodparam><parameter
			 role="keyword">rectangle</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">rectangle</parameter>&nbsp;:</term> <listitem><simpara>a
<link
linkend="class-gdkrectangle"><classname>gtk.gdk.Rectangle</classname></link>
to use for clipping</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_clip_rectangle</methodname>() method sets
the clip mask for the graphics context from the <link
linkend="class-gdkrectangle"><classname>gtk.gdk.Rectangle</classname></link>
specified by <parameter>rectangle</parameter> and sets the clip origin to
(0, 0). The clip origin can be changed using the <link
linkend="method-gdkgc--set-clip-origin"><methodname>set_clip_origin</methodname>()</link>
method.</para>

    </refsect2>

    <refsect2 id="method-gdkgc--set-clip-region">
      <title>gtk.gdk.GC.set_clip_region</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_clip_region</methodname>
        <methodparam><parameter role="keyword">region</parameter></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">region</parameter>&nbsp;:</term>
          <listitem><simpara>a <link
          linkend="class-gdkregion"><classname>gtk.gdk.Region</classname></link></simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>set_clip_region</methodname>() method sets the
      clip mask for a graphics context from the <link
      linkend="class-gdkregion"><classname>gtk.gdk.Region</classname></link>
      specified by <parameter>region</parameter>. The clip mask is
      interpreted relative to the clip origin. (See the <link
      linkend="method-gdkgc--set-clip-origin"><methodname>set_clip_origin</methodname>()</link>
      method).</para>

    </refsect2>

    <refsect2 id="method-gdkgc--set-subwindow">
      <title>gtk.gdk.GC.set_subwindow</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_subwindow</methodname>
	  <methodparam><parameter
			 role="keyword">mode</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">mode</parameter>&nbsp;:</term>
	  <listitem><simpara>the new subwindow mode</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_subwindow</methodname>() method sets the
mode of drawing on subwindows when drawing on a <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> to
the value specified by <parameter>mode</parameter>. The value of mode must
be one of:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gtk.gdk.CLIP_BY_CHILDREN</literal></term>
	  <listitem>
	    <simpara>only draw onto the window itself not the
subwindows.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INCLUDE_INFERIORS</literal></term>
	  <listitem>
	    <simpara>draw onto the window and child windows.</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para></para>

    </refsect2>

    <refsect2 id="method-gdkgc--set-exposures">
      <title>gtk.gdk.GC.set_exposures</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_exposures</methodname>
	  <methodparam><parameter
			 role="keyword">exposures</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">exposures</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> exposure events will
be generated for non-visible areas</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_exposures</methodname>() method sets an
attribute that determines if copying non-visible portions of a drawable
using this graphics context will generate exposure events for the
corresponding regions of the destination drawable. If
<parameter>exposures</parameter> is <literal>True</literal> exposure events
will be generated for non-visible areas. See the <link
linkend="method-gdkdrawable--draw-drawable"><methodname>gtk.gdk.Drawable.draw_drawable</methodname>()</link> 
method. </para>

    </refsect2>

    <refsect2 id="method-gdkgc--set-line-attributes">
      <title>gtk.gdk.GC.set_line_attributes</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_line_attributes</methodname>
	  <methodparam><parameter
			 role="keyword">line_width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">line_style</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">cap_style</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">join_style</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">line_width</parameter>&nbsp;:</term>
	  <listitem><simpara>the new line width in
pixels</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">line_style</parameter>&nbsp;:</term>
	  <listitem><simpara>the new line style</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">cap_style</parameter>&nbsp;:</term>
	  <listitem><simpara>the new line end style</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">join_style</parameter>&nbsp;:</term>
	  <listitem><simpara>the new line join style</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_line_attributes</methodname>() method sets
the attributes to be used when drawing a line using the graphics context to
the values specified by <parameter>line_width</parameter>,
<parameter>line_style</parameter>, <parameter>cap_style</parameter> and
<parameter>join_style</parameter>. The value of
<parameter>line_style</parameter> must be one of:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gtk.gdk.LINE_SOLID</literal></term>
	  <listitem>
	    <simpara>Lines are drawn solid.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.LINE_ON_OFF_DASH</literal></term>
	  <listitem>
	    <simpara>Lines are drawn dashed where even segments are drawn
but odd segments are not drawn.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.LINE_DOUBLE_DASH</literal></term>
	  <listitem>
	    <simpara>Lines are drawn dashed where even segments are drawn
normally but odd segments are drawn in the background color if the fill
style is <literal>gtk.gdk.SOLID</literal>, or in the background color masked
by the stipple if the fill style is
<literal>gtk.gdk.STIPPLED</literal>.</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para>The value of cap_style must be one of:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gtk.gdk.CAP_NOT_LAST</literal></term>
	  <listitem>
	    <simpara>The same as <literal>gtk.gdk.CAP_BUTT</literal> for
lines of non-zero width but for zero width lines, the final point on the
line will not be drawn.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.CAP_BUTT</literal></term>
	  <listitem>
	    <simpara>The ends of the lines are drawn squared off and
extending to the coordinates of the end point.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.CAP_ROUND</literal></term>
	  <listitem>
	    <simpara>The ends of the lines are drawn as semicircles with the
diameter equal to the line width and centered at the end point.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.CAP_PROJECTING</literal></term>
	  <listitem>
	    <simpara>The ends of the lines are drawn squared off and
extending half the width of the line beyond the end point.</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para>The value of join_style must be one of:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gtk.gdk.JOIN_MITER</literal></term>
	  <listitem>
	    <simpara>The sides of each line are extended to meet at an
angle.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.JOIN_ROUND</literal></term>
	  <listitem>
	    <simpara>The sides of the two lines are joined by a circular
arc.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.JOIN_BEVEL</literal></term>
	  <listitem>
	    <simpara>The sides of the two lines are joined by a straight
line which makes an equal angle with each line.</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para></para>

  </refsect2>

    <refsect2 id="method-gdkgc--set-dashes">
      <title>gtk.gdk.GC.set_dashes</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_dashes</methodname>
	  <methodparam><parameter
			 role="keyword">dash_offset</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dash_list</parameter></methodparam>
	  <methodparam><parameter role="keyword">n</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>dash_offset</parameter>&nbsp;:</term>
	  <listitem><simpara>the index of the length in
<parameter>dash_list</parameter> to use as the firstst
dash</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>dash_list</parameter>&nbsp;:</term>
	  <listitem><simpara>the tuple or list of dash lengths in
pixels</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_dashes</methodname>() method sets the
pattern for drawing dashed lines using the tuple or list of dash lengths
specified by <parameter>dash_list</parameter> with the index of the starting
dash length specified by <parameter>dash_offset</parameter>. The dashes are
drawn starting with the number of pixels at the offset position; then the
next number of pixels is skipped; and then the next number is drawn; and so
on rotating through all the <parameter>dash_list</parameter> numbers and
starting over when the end is reached. For example, if
<parameter>dash_list</parameter> is (2, 4, 8, 16) and the offset is 1, the
dashes will be drawn as: draw 4 pixels, skip 8 pixels, draw 16 pixels, skip
2 pixels, draw 4 pixels and so on.</para>

    </refsect2>

    <refsect2 id="method-gdkgc--offset">
      <title>gtk.gdk.GC.offset</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>offset</methodname>
	  <methodparam><parameter
			 role="keyword">x_offset</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">y_offset</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">x_offset</parameter>&nbsp;:</term>
	  <listitem><simpara>the amount by which to offset the graphics context in the X
direction</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y_offset</parameter>&nbsp;:</term>
	  <listitem><simpara>the amount by which to offset the graphics context in the Y
direction</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>offset</methodname>() method sets offset
attributes such as the clip and tile-stipple origins of the graphics context so that
drawing at x - <parameter>x_offset</parameter>, y -
<parameter>y_offset</parameter> with the offset graphics context  has the same effect as
drawing at x, y with the original graphics context.</para>

    </refsect2>

    <refsect2 id="method-gdkgc--copy">
      <title>gtk.gdk.GC.copy</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>copy</methodname>
	  <methodparam><parameter
			 role="keyword">src_gc</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">src_gc</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> to
copy</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>copy</methodname>() method copies the attributes
of the <link linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link>
specified by <parameter>src_gc</parameter> into this graphics context.</para>

    </refsect2>

    <refsect2 id="method-gdkgc--set-colormap">
      <title>gtk.gdk.GC.set_colormap</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_colormap</methodname>
	  <methodparam><parameter
			 role="keyword">colormap</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">colormap</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkcolormap"><classname>gtk.gdk.Colormap</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_colormap</methodname>() method sets the
colormap for the graphics context to the specified
<parameter>colormap</parameter>. The depth of the colormap's visual must
match the depth of the drawable for which the graphics context was
created.</para>

    </refsect2>

    <refsect2 id="method-gdkgc--get-colormap">
      <title>gtk.gdk.GC.get_colormap</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_colormap</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the colormap used by the graphics
context</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_colormap</methodname>() method returns the
colormap for the graphics context, if it exists. A graphics context will
have a colormap if the drawable for which it was created has a colormap, or
if a colormap was set explicitly with the <link
linkend="method-gdkgc--set-colormap"><methodname>set_colormap</methodname>()</link> 
method.</para>

    </refsect2>

    <refsect2 id="method-gdkgc--set-rgb-fg-color">
      <title>gtk.gdk.GC.set_rgb_fg_color</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_rgb_fg_color</methodname>
	  <methodparam><parameter
			 role="keyword">color</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">color</parameter>&nbsp;:</term>
	  <listitem><simpara>an unallocated <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_rgb_fg_color</methodname>() method sets the
foreground color of a graphics context using the specified unallocated
<parameter>color</parameter>. The pixel value for
<parameter>color</parameter> will be determined using GdkRGB. If the
colormap for the graphics context has not previously been initialized for
GdkRGB, then for pseudo-color colormaps (colormaps with a small modifiable
number of colors), a colorcube will be allocated in the colormap. Calling
this method for a graphics context without a colormap is an error.</para>

    </refsect2>

    <refsect2 id="method-gdkgc--set-rgb-bg-color">
      <title>gtk.gdk.GC.set_rgb_bg_color</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_rgb_bg_color</methodname>
	  <methodparam><parameter
			 role="keyword">color</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">color</parameter>&nbsp;:</term>
	  <listitem><simpara>an unallocated <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_rgb_bg_color</methodname>() method sets the
background color of a graphics context using the specified unallocated
<parameter>color</parameter>. The pixel value for
<parameter>color</parameter> will be determined using GdkRGB. If the
colormap for the graphics context has not previously been initialized for
GdkRGB, then for pseudo-color colormaps (colormaps with a small modifiable
number of colors), a colorcube will be allocated in the colormap. Calling
this method for a graphics context without a colormap is an error.</para>

    </refsect2>

    <refsect2 id="method-gdkgc--get-screen">
      <title>gtk.gdk.GC.get_screen</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_screen</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the <link
	  linkend="class-gdkscreen"><classname>gtk.gdk.Screen</classname></link>
	  for the gc</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.2. and above.</para>
      </note>

      <para>The <methodname>get_screen</methodname>() method returns the
<link linkend="class-gdkscreen"><classname>gtk.gdk.Screen</classname></link>
on which the gc was created.</para>

    </refsect2>

  </refsect1>

</refentry>
