/usr/share/gtk-doc/html/pygtk/class-gdkgc.html is in python-gtk2-doc 2.24.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.gdk.GC</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gdk-class-reference.html" title="The gtk.gdk Class Reference"><link rel="prev" href="class-gdkevent.html" title="gtk.gdk.Event"><link rel="next" href="class-gdkimage.html" title="gtk.gdk.Image"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.gdk.GC</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gdkevent.html">Prev</a> </td><th width="60%" align="center">The gtk.gdk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gdkimage.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.gdk.GC"><a name="class-gdkgc"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.gdk.GC</h2><p>gtk.gdk.GC — objects to encapsulate drawing properties.</p></div><div class="refsect1" title="Synopsis"><a name="id2910059"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.gdk.GC</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-gdkgc.html#constructor-gdkgc" title="Constructor">gtk.gdk.GC</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>drawable</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>foreground</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>background</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>font</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>function</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>fill</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>tile</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>stipple</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>clip_mask</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>subwindow_mode</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>ts_x_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>ts_y_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>clip_x_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>clip_y_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>graphics_exposures</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>line_width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>line_style</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cap_style</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>join_style</code></strong></span>></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-values" title="gtk.gdk.GC.set_values">set_values</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>foreground</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>background</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>font</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>function</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>fill</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>tile</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>stipple</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>clip_mask</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>subwindow_mode</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>ts_x_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>ts_y_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>clip_x_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>clip_y_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>graphics_exposures</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>line_width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>line_style</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cap_style</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>join_style</code></strong></span>></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-foreground" title="gtk.gdk.GC.set_foreground">set_foreground</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>color</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-background" title="gtk.gdk.GC.set_background">set_background</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>color</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-function" title="gtk.gdk.GC.set_function">set_function</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>function</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-fill" title="gtk.gdk.GC.set_fill">set_fill</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>fill</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-tile" title="gtk.gdk.GC.set_tile">set_tile</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>tile</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-stipple" title="gtk.gdk.GC.set_stipple">set_stipple</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>stipple</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-ts-origin" title="gtk.gdk.GC.set_ts_origin">set_ts_origin</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-clip-origin" title="gtk.gdk.GC.set_clip_origin">set_clip_origin</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-clip-mask" title="gtk.gdk.GC.set_clip_mask">set_clip_mask</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mask</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-clip-rectangle" title="gtk.gdk.GC.set_clip_rectangle">set_clip_rectangle</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>rectangle</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-clip-region" title="gtk.gdk.GC.set_clip_region">set_clip_region</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>region</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-subwindow" title="gtk.gdk.GC.set_subwindow">set_subwindow</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mode</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-exposures" title="gtk.gdk.GC.set_exposures">set_exposures</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>exposures</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-line-attributes" title="gtk.gdk.GC.set_line_attributes">set_line_attributes</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>line_width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>line_style</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cap_style</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>join_style</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-dashes" title="gtk.gdk.GC.set_dashes">set_dashes</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>dash_offset</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>dash_list</code></em></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--offset" title="gtk.gdk.GC.offset">offset</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y_offset</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--copy" title="gtk.gdk.GC.copy">copy</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>src_gc</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-colormap" title="gtk.gdk.GC.set_colormap">set_colormap</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>colormap</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--get-colormap" title="gtk.gdk.GC.get_colormap">get_colormap</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-rgb-fg-color" title="gtk.gdk.GC.set_rgb_fg_color">set_rgb_fg_color</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>color</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--set-rgb-bg-color" title="gtk.gdk.GC.set_rgb_bg_color">set_rgb_bg_color</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>color</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkgc.html#method-gdkgc--get-screen" title="gtk.gdk.GC.get_screen">get_screen</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id3044818"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gdkgc.html" title="gtk.gdk.GC">gtk.gdk.GC</a>
</pre></div><div class="refsect1" title="Attributes"><a name="id3044804"></a><h2>Attributes</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table cellpadding="5" width="100%" border="0"><colgroup><col width="1in"><col width="1in"><col width="4in"></colgroup><tbody><tr valign="top"><td valign="top">"background"</td><td valign="top">Read-Write</td><td valign="top">The background <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a>.</td></tr><tr valign="top"><td valign="top">"cap_style"</td><td valign="top">Read-Write</td><td valign="top">The style of drawing the ends of lines - one of:
<code class="literal">gtk.gdk.CAP_NOT_LAST</code>,
<code class="literal">gtk.gdk.CAP_BUTT</code>, <code class="literal">gtk.gdk.CAP_ROUND</code> or
<code class="literal">gtk.gdk.CAP_PROJECTING</code>.</td></tr><tr valign="top"><td valign="top">"clip_mask"</td><td valign="top">Read-Write</td><td valign="top">A <a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a>
bitmap used to clip the drawing operation.</td></tr><tr valign="top"><td valign="top">"clip_x_origin"</td><td valign="top">Read-Write</td><td valign="top">The x origin of the clip mask.</td></tr><tr valign="top"><td valign="top">"clip_y_origin"</td><td valign="top">Read-Write</td><td valign="top">The y origin of the clip mask.</td></tr><tr valign="top"><td valign="top">"fill"</td><td valign="top">Read-Write</td><td valign="top">The fill style - one of:
<code class="literal">gtk.gdk.SOLID</code>, <code class="literal">gtk.gdk.TILED</code>,
<code class="literal">gtk.gdk.STIPPLED</code> or
<code class="literal">gtk.gdk.OPAQUE_STIPPLED</code>.</td></tr><tr valign="top"><td valign="top">"font"</td><td valign="top">Read-Write</td><td valign="top">The default font (deprecated and unused)</td></tr><tr valign="top"><td valign="top">"foreground"</td><td valign="top">Read-Write</td><td valign="top">The foreground <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a>.</td></tr><tr valign="top"><td valign="top">"function"</td><td valign="top">Read-Write</td><td valign="top">A bitwise operation type to combine source and
destination pixels - one of: <code class="literal">gtk.gdk.COPY</code>,
<code class="literal">gtk.gdk.INVERT</code>, <code class="literal">gtk.gdk.XOR</code>,
<code class="literal">gtk.gdk.CLEAR</code>, <code class="literal">gtk.gdk.AND</code>,
<code class="literal">gtk.gdk.AND_REVERSE</code>,
<code class="literal">gtk.gdk.AND_INVERT</code>, <code class="literal">gtk.gdk.NOOP</code>,
<code class="literal">gtk.gdk.OR</code>, <code class="literal">gtk.gdk.EQUIV</code>,
<code class="literal">gtk.gdk.OR_REVERSE</code>,
<code class="literal">gtk.gdk.COPY_INVERT</code>,
<code class="literal">gtk.gdk.OR_INVERT</code>, <code class="literal">gtk.gdk.NAND</code>,
<code class="literal">gtk.gdk.NOR</code> or <code class="literal">gtk.gdk.SET</code>.</td></tr><tr valign="top"><td valign="top">"graphics_exposures"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code> graphics exposures are
enabled.</td></tr><tr valign="top"><td valign="top">"join_style"</td><td valign="top">Read-Write</td><td valign="top">The style used to join lines - one of:
<code class="literal">gtk.gdk.JOIN_MITER</code>, <code class="literal">gtk.gdk.JOIN_ROUND</code>
or <code class="literal">gtk.gdk.JOIN_BEVEL</code>.</td></tr><tr valign="top"><td valign="top">"line_style"</td><td valign="top">Read-Write</td><td valign="top">The style of drawing lines - one of:
<code class="literal">gtk.gdk.LINE_SOLID</code>,
<code class="literal">gtk.gdk.LINE_ON_OFF_DASH</code> or
<code class="literal">gtk.gdk.LINE_DOUBLE_DASH</code>.</td></tr><tr valign="top"><td valign="top">"line_width"</td><td valign="top">Read-Write</td><td valign="top">The width of a line in pixels.</td></tr><tr valign="top"><td valign="top">"stipple"</td><td valign="top">Read-Write</td><td valign="top">The <a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a>
bitmap used to stipple the background.</td></tr><tr valign="top"><td valign="top">"sub_window"</td><td valign="top">Read-Write</td><td valign="top">The mode of drawing in a <a class="link" href="class-gdkwindow.html" title="gtk.gdk.Window"><code class="classname">gtk.gdk.Window</code></a> with
subwindows - one of: <code class="literal">gtk.gdk.CLIP_BY_CHILDREN</code> or
<code class="literal">gtk.gdk.INCLUDE_INFERIORS</code>.</td></tr><tr valign="top"><td valign="top">"tile"</td><td valign="top">Read-Write</td><td valign="top">The <a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a> used
to tile the background.</td></tr><tr valign="top"><td valign="top">"ts_x_origin"</td><td valign="top">Read-Write</td><td valign="top">The x origin of the tile or stipple.</td></tr><tr valign="top"><td valign="top">"ts_y_origin"</td><td valign="top">Read-Write</td><td valign="top">The y origin of the tile or stipple.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="Description"><a name="id2917074"></a><h2>Description</h2><p>All drawing operations in <code class="literal">PyGTK</code> take a graphics
context (<a class="link" href="class-gdkgc.html" title="gtk.gdk.GC"><code class="classname">gtk.gdk.GC</code></a>) argument
(See the <a class="link" href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><code class="classname">gtk.gdk.Drawable</code></a>
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 <a class="link" href="class-gdkdrawable.html#method-gdkdrawable--new-gc" title="gtk.gdk.Drawable.new_gc"><code class="methodname">gtk.gdk.Drawable.new_gc</code>()</a>,
or can be set one-by-one using functions such as <a class="link" href="class-gdkgc.html#method-gdkgc--set-foreground" title="gtk.gdk.GC.set_foreground"><code class="methodname">set_foreground</code>()</a>
or by setting a <a class="link" href="class-gdkgc.html" title="gtk.gdk.GC"><code class="classname">gtk.gdk.GC</code></a> attribute. A
few of the values in the <a class="link" href="class-gdkgc.html" title="gtk.gdk.GC"><code class="classname">gtk.gdk.GC</code></a>, such as the
dash pattern, can only be set by the latter method.</p><p>Note that all coordinates except for clip mask and clip region are relative to
destination drawable (e.g. <a class="link" href="class-gdkwindow.html" title="gtk.gdk.Window">gtk.gdk.Window</a>)
origin. In particular, coordinates are <span class="emphasis"><em>not</em></span> related to widget
allocation.</p></div><div class="refsect1" title="Constructor"><a name="constructor-gdkgc"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.gdk.GC</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>drawable</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>foreground</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>background</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>font</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>function</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>fill</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>tile</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>stipple</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>clip_mask</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>subwindow_mode</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>ts_x_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>ts_y_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>clip_x_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>clip_y_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>graphics_exposures</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>line_width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>line_style</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cap_style</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>join_style</code></strong></span>></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>drawable</code></strong> :</span></p></td><td>A <a class="link" href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><code class="classname">gtk.gdk.Drawable</code></a>
(<a class="link" href="class-gdkwindow.html" title="gtk.gdk.Window"><code class="classname">gtk.gdk.Window</code></a> or
<a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a>)</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>foreground</code></strong> :</span></p></td><td>the foreground <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>background</code></strong> :</span></p></td><td>the background <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>font</code></strong> :</span></p></td><td>a font (deprecated and
ignored)</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>function</code></strong> :</span></p></td><td>the bitwise operator used to combine the existing
pixel value and a new pixel value - usually one of:
<code class="literal">gtk.gdk.COPY</code>, <code class="literal">gtk.gdk.XOR</code> or
<code class="literal">gtk.gdk.INVERT</code>.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>fill</code></strong> :</span></p></td><td>the fill style - one of:
<code class="literal">gtk.gdk.SOLID</code>, <code class="literal">gtk.gdk.TILED</code>,
<code class="literal">gtk.gdk.STIPPLED</code>,
<code class="literal">gtk.gdk.OPAQUE_STIPPLED</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>tile</code></strong> :</span></p></td><td>a <a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a> used
for tiling the background</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>stipple</code></strong> :</span></p></td><td>a <a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a> used
for stippling the background</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>clip_mask</code></strong> :</span></p></td><td>a <a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a> of
depth 1 used to mask pixels to be drawn</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>subwindow_mode</code></strong> :</span></p></td><td>the mode of drawing on subwindows in a <a class="link" href="class-gdkwindow.html" title="gtk.gdk.Window"><code class="classname">gtk.gdk.Window</code></a>
- one of: <code class="literal">gtk.gdk.CLIP_BY_CHILDREN</code> or
<code class="literal">gtk.gdk.INCLUDE_INFERIORS</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>ts_x_origin</code></strong> :</span></p></td><td>the X coordinate of the origin of
<em class="parameter"><code>tile</code></em> or
<em class="parameter"><code>stipple</code></em></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>ts_y_origin</code></strong> :</span></p></td><td>the Y coordinate of the origin of
<em class="parameter"><code>tile</code></em> or
<em class="parameter"><code>stipple</code></em></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>clip_x_origin</code></strong> :</span></p></td><td>the X coordinate of the origin of
<em class="parameter"><code>clip_mask</code></em></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>clip_y_origin</code></strong> :</span></p></td><td>the Y coordinate of the origin of
<em class="parameter"><code>clip_mask</code></em></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>graphics_exposures</code></strong> :</span></p></td><td>if <code class="literal">True</code> graphics exposures are
enabled for calls to the <a class="link" href="class-gdkdrawable.html#method-gdkdrawable--draw-drawable" title="gtk.gdk.Drawable.draw_drawable"><code class="methodname">gtk.gdk.Drawable.draw_drawable</code>()</a>
method.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>line_width</code></strong> :</span></p></td><td>the line width in pixels</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>line_style</code></strong> :</span></p></td><td>the line style - one of:
<code class="literal">gtk.gdk.LINE_SOLID</code>,
<code class="literal">gtk.gdk.LINE_ON_OFF_DASH</code>,
<code class="literal">gtk.gdk.LINE_DOUBLE_DASH</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>cap_style</code></strong> :</span></p></td><td>the style of line ends - one of:
<code class="literal">gtk.gdk.CAP_NOT_LAST</code>,
<code class="literal">gtk.gdk.CAP_BUTT</code>, <code class="literal">gtk.gdk.CAP_ROUND</code>,
<code class="literal">gtk.gdk.CAP_PROJECTING</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>join_style</code></strong> :</span></p></td><td>the style of line joins - one of:
<code class="literal">gtk.gdk.JOIN_MITER</code>,
<code class="literal">gtk.gdk.JOIN_ROUND</code>,
<code class="literal">gtk.gdk.JOIN_BEVEL</code></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-gdkgc.html" title="gtk.gdk.GC"><code class="classname">gtk.gdk.GC</code></a>
object</td></tr></tbody></table><p>Creates a new <a class="link" href="class-gdkgc.html" title="gtk.gdk.GC"><code class="classname">gtk.gdk.GC</code></a> object for
the <a class="link" href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><code class="classname">gtk.gdk.Drawable</code></a>
specified by <em class="parameter"><code>drawable</code></em> 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 <a class="link" href="class-gdkdrawable.html#method-gdkdrawable--new-gc" title="gtk.gdk.Drawable.new_gc"><code class="methodname">gtk.gdk.Drawable.new_gc</code>()</a>
method. Since there are a large number of optional attribute parameters it's
probably best to specify the attribute values using keywords.</p></div><div class="refsect1" title="Methods"><a name="id3155553"></a><h2>Methods</h2><div class="refsect2" title="gtk.gdk.GC.set_values"><a name="method-gdkgc--set-values"></a><h3>gtk.gdk.GC.set_values</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_values</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>values</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>foreground</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>background</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>font</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>function</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>fill</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>tile</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>stipple</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>clip_mask</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>subwindow_mode</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>ts_x_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>ts_y_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>clip_x_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>clip_y_origin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>graphics_exposures</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>line_width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>line_style</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cap_style</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>join_style</code></strong></span>></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>foreground</code></strong> :</span></p></td><td>the foreground <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>background</code></strong> :</span></p></td><td>the background <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>font</code></strong> :</span></p></td><td>a font (deprecated and
ignored)</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>function</code></strong> :</span></p></td><td>the bitwise operator used to combine the
existing pixel value and a new pixel value - usually one of:
<code class="literal">gtk.gdk.COPY</code>, <code class="literal">gtk.gdk.XOR</code> or
<code class="literal">gtk.gdk.INVERT</code>.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>fill</code></strong> :</span></p></td><td>the fill style - one of:
<code class="literal">gtk.gdk.SOLID</code>, <code class="literal">gtk.gdk.TILED</code>,
<code class="literal">gtk.gdk.STIPPLED</code>,
<code class="literal">gtk.gdk.OPAQUE_STIPPLED</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>tile</code></strong> :</span></p></td><td>a <a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a> used
for tiling the background</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>stipple</code></strong> :</span></p></td><td>a <a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a> used
for stippling the background</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>clip_mask</code></strong> :</span></p></td><td>a <a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a> of
depth 1 used to mask pixels to be drawn</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>subwindow_mode</code></strong> :</span></p></td><td>the mode of drawing on subwindows in a
<a class="link" href="class-gdkwindow.html" title="gtk.gdk.Window"><code class="classname">gtk.gdk.Window</code></a> - one of: <code class="literal">gtk.gdk.CLIP_BY_CHILDREN</code> or
<code class="literal">gtk.gdk.INCLUDE_INFERIORS</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>ts_x_origin</code></strong> :</span></p></td><td>the X coordinate of the origin of
<em class="parameter"><code>tile</code></em> or
<em class="parameter"><code>stipple</code></em></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>ts_y_origin</code></strong> :</span></p></td><td>the Y coordinate of the origin of
<em class="parameter"><code>tile</code></em> or
<em class="parameter"><code>stipple</code></em></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>clip_x_origin</code></strong> :</span></p></td><td>the X coordinate of the origin of
<em class="parameter"><code>clip_mask</code></em></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>clip_y_origin</code></strong> :</span></p></td><td>the Y coordinate of the origin of
<em class="parameter"><code>clip_mask</code></em></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>graphics_exposures</code></strong> :</span></p></td><td>if <code class="literal">True</code> graphics exposures
are enabled for calls to the <a class="link" href="class-gdkdrawable.html#method-gdkdrawable--draw-drawable" title="gtk.gdk.Drawable.draw_drawable"><code class="methodname">gtk.gdk.Drawable.draw_drawable</code>()</a>
method.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>line_width</code></strong> :</span></p></td><td>the line width in pixels</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>line_style</code></strong> :</span></p></td><td>the line style - one of:
<code class="literal">gtk.gdk.LINE_SOLID</code>,
<code class="literal">gtk.gdk.LINE_ON_OFF_DASH</code>,
<code class="literal">gtk.gdk.LINE_DOUBLE_DASH</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>cap_style</code></strong> :</span></p></td><td>the style of line ends - one of:
<code class="literal">gtk.gdk.CAP_NOT_LAST</code>,
<code class="literal">gtk.gdk.CAP_BUTT</code>, <code class="literal">gtk.gdk.CAP_ROUND</code>,
<code class="literal">gtk.gdk.CAP_PROJECTING</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>join_style</code></strong> :</span></p></td><td>the style of line joins - one of:
<code class="literal">gtk.gdk.JOIN_MITER</code>,
<code class="literal">gtk.gdk.JOIN_ROUND</code>,
<code class="literal">gtk.gdk.JOIN_BEVEL</code></td></tr></tbody></table><p>The <code class="methodname">set_values</code>() 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.</p></div><div class="refsect2" title="gtk.gdk.GC.set_foreground"><a name="method-gdkgc--set-foreground"></a><h3>gtk.gdk.GC.set_foreground</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_foreground</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>color</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>color</code></strong> :</span></p></td><td>the new foreground <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a></td></tr></tbody></table><p>The <code class="methodname">set_foreground</code>() method sets the
foreground <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a> to the
value specified by <em class="parameter"><code>color</code></em>.</p></div><div class="refsect2" title="gtk.gdk.GC.set_background"><a name="method-gdkgc--set-background"></a><h3>gtk.gdk.GC.set_background</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_background</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>color</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>color</code></strong> :</span></p></td><td>the new background <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a></td></tr></tbody></table><p>The <code class="methodname">set_background</code>() method sets the
background <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a> to the
value specified by <em class="parameter"><code>color</code></em>.</p></div><div class="refsect2" title="gtk.gdk.GC.set_function"><a name="method-gdkgc--set-function"></a><h3>gtk.gdk.GC.set_function</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_function</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>function</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>function</code></strong> :</span></p></td><td>the bitwise operator used to combine the
existing pixel value and a new pixel value - usually one of:
<code class="literal">gtk.gdk.COPY</code>, <code class="literal">gtk.gdk.XOR</code> or
<code class="literal">gtk.gdk.INVERT</code>.</td></tr></tbody></table><p>The <code class="methodname">set_function</code>() method sets the
function attribute to the value specified by
<em class="parameter"><code>function</code></em>. The value of
<em class="parameter"><code>function</code></em> must be one of:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><code class="literal">gtk.gdk.COPY</code></li><li class="listitem"><code class="literal">gtk.gdk.INVERT</code></li><li class="listitem"><code class="literal">gtk.gdk.XOR</code></li><li class="listitem"><code class="literal">gtk.gdk.CLEAR</code></li><li class="listitem"><code class="literal">gtk.gdk.AND</code></li><li class="listitem"><code class="literal">gtk.gdk.AND_REVERSE.</code></li><li class="listitem"><code class="literal">gtk.gdk.AND_INVERT</code></li><li class="listitem"><code class="literal">gtk.gdk.NOOP</code></li><li class="listitem"><code class="literal">gtk.gdk.OR</code></li><li class="listitem"><code class="literal">gtk.gdk.EQUIV</code></li><li class="listitem"><code class="literal">gtk.gdk.OR_REVERSE</code></li><li class="listitem"><code class="literal">gtk.gdk.COPY_INVERT</code></li><li class="listitem"><code class="literal">gtk.gdk.OR_INVERT</code></li><li class="listitem"><code class="literal">gtk.gdk.NAND</code></li><li class="listitem"><code class="literal">gtk.gdk.NOR</code></li><li class="listitem"><code class="literal">gtk.gdk.SET</code></li></ul></div><p>Only a couple of these values are usually useful. For colored
images, only <code class="literal">gtk.gdk.COPY</code>, <code class="literal">gtk.gdk.XOR</code>
and <code class="literal">gtk.gdk.INVERT</code> are generally useful. For bitmaps,
<code class="literal">gtk.gdk.AND</code> and <code class="literal">gtk.gdk.OR</code> are also
useful. </p></div><div class="refsect2" title="gtk.gdk.GC.set_fill"><a name="method-gdkgc--set-fill"></a><h3>gtk.gdk.GC.set_fill</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_fill</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>fill</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>fill</code></strong> :</span></p></td><td>the new fill mode</td></tr></tbody></table><p>The <code class="methodname">set_fill</code>() method sets the fill
mode for the graphics context to the value specified by
<em class="parameter"><code>fill</code></em>. The value of <em class="parameter"><code>fill</code></em> must
be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><code class="literal">gtk.gdk.SOLID</code></span></p></td><td>draw with the foreground color. </td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.TILED</code></span></p></td><td>draw with a tiled pixmap.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.STIPPLED</code></span></p></td><td>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.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.OPAQUE_STIPPLED</code></span></p></td><td>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.</td></tr></tbody></table><p></p></div><div class="refsect2" title="gtk.gdk.GC.set_tile"><a name="method-gdkgc--set-tile"></a><h3>gtk.gdk.GC.set_tile</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_tile</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>tile</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>tile</code></strong> :</span></p></td><td>a <a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a></td></tr></tbody></table><p>The <code class="methodname">set_tile</code>() method sets the <a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a>
specified by <em class="parameter"><code>tile</code></em> to be used for filling the
background when the fill mode is <code class="literal">gtk.gdk.TILED</code>.</p></div><div class="refsect2" title="gtk.gdk.GC.set_stipple"><a name="method-gdkgc--set-stipple"></a><h3>gtk.gdk.GC.set_stipple</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_stipple</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>stipple</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>stipple</code></strong> :</span></p></td><td>a <a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a> bitmap</td></tr></tbody></table><p>The <code class="methodname">set_stipple</code>() method sets the <a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a>
bitmap specified by <em class="parameter"><code>stipple</code></em> to be used for stippling
the background. <em class="parameter"><code>stipple</code></em> will only be used if the fill
mode is <code class="literal">gtk.gdk.STIPPLED</code> or
<code class="literal">gtk.gdk.OPAQUE_STIPPLED</code>.</p></div><div class="refsect2" title="gtk.gdk.GC.set_ts_origin"><a name="method-gdkgc--set-ts-origin"></a><h3>gtk.gdk.GC.set_ts_origin</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_ts_origin</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>x</code></strong> :</span></p></td><td>the x origin of the tile or
stipple</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y</code></strong> :</span></p></td><td>the y origin of the tile or
stipple</td></tr></tbody></table><p>The <code class="methodname">set_ts_origin</code>() method sets the
origin of the tile or stipple to the value specified by
<em class="parameter"><code>x</code></em> and <em class="parameter"><code>y</code></em>. The tile or stipple
will be aligned such that the upper left corner of the tile or stipple will
coincide with this point.</p></div><div class="refsect2" title="gtk.gdk.GC.set_clip_origin"><a name="method-gdkgc--set-clip-origin"></a><h3>gtk.gdk.GC.set_clip_origin</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_clip_origin</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>x</code></strong> :</span></p></td><td>the x origin of the clip
mask</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y</code></strong> :</span></p></td><td>the y origin of the clip
mask</td></tr></tbody></table><p>The <code class="methodname">set_clip_origin</code>() method sets the
origin of the clip mask to the value specified by <em class="parameter"><code>x</code></em>
and <em class="parameter"><code>y</code></em>. The coordinates are interpreted relative to
the upper-left corner of the destination drawable of the current
operation.</p></div><div class="refsect2" title="gtk.gdk.GC.set_clip_mask"><a name="method-gdkgc--set-clip-mask"></a><h3>gtk.gdk.GC.set_clip_mask</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_clip_mask</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mask</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>mask</code></strong> :</span></p></td><td>a <a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a></td></tr></tbody></table><p>The <code class="methodname">set_clip_mask</code>() method sets the
clip mask (a <a class="link" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><code class="classname">gtk.gdk.Pixmap</code></a> bit
map) to the value specified by <em class="parameter"><code>mask</code></em>. The clip mask is
interpreted relative to the clip origin. See the <a class="link" href="class-gdkgc.html#method-gdkgc--set-clip-origin" title="gtk.gdk.GC.set_clip_origin"><code class="methodname">set_clip_origin</code>()</a>
method.</p></div><div class="refsect2" title="gtk.gdk.GC.set_clip_rectangle"><a name="method-gdkgc--set-clip-rectangle"></a><h3>gtk.gdk.GC.set_clip_rectangle</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_clip_rectangle</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>rectangle</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>rectangle</code></strong> :</span></p></td><td>a
<a class="link" href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><code class="classname">gtk.gdk.Rectangle</code></a>
to use for clipping</td></tr></tbody></table><p>The <code class="methodname">set_clip_rectangle</code>() method sets
the clip mask for the graphics context from the <a class="link" href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><code class="classname">gtk.gdk.Rectangle</code></a>
specified by <em class="parameter"><code>rectangle</code></em> and sets the clip origin to
(0, 0). The clip origin can be changed using the <a class="link" href="class-gdkgc.html#method-gdkgc--set-clip-origin" title="gtk.gdk.GC.set_clip_origin"><code class="methodname">set_clip_origin</code>()</a>
method.</p></div><div class="refsect2" title="gtk.gdk.GC.set_clip_region"><a name="method-gdkgc--set-clip-region"></a><h3>gtk.gdk.GC.set_clip_region</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_clip_region</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>region</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>region</code></strong> :</span></p></td><td>a <a class="link" href="class-gdkregion.html" title="gtk.gdk.Region"><code class="classname">gtk.gdk.Region</code></a></td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.10 and above.</p></div><p>The <code class="methodname">set_clip_region</code>() method sets the
clip mask for a graphics context from the <a class="link" href="class-gdkregion.html" title="gtk.gdk.Region"><code class="classname">gtk.gdk.Region</code></a>
specified by <em class="parameter"><code>region</code></em>. The clip mask is
interpreted relative to the clip origin. (See the <a class="link" href="class-gdkgc.html#method-gdkgc--set-clip-origin" title="gtk.gdk.GC.set_clip_origin"><code class="methodname">set_clip_origin</code>()</a>
method).</p></div><div class="refsect2" title="gtk.gdk.GC.set_subwindow"><a name="method-gdkgc--set-subwindow"></a><h3>gtk.gdk.GC.set_subwindow</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_subwindow</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mode</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>mode</code></strong> :</span></p></td><td>the new subwindow mode</td></tr></tbody></table><p>The <code class="methodname">set_subwindow</code>() method sets the
mode of drawing on subwindows when drawing on a <a class="link" href="class-gdkwindow.html" title="gtk.gdk.Window"><code class="classname">gtk.gdk.Window</code></a> to
the value specified by <em class="parameter"><code>mode</code></em>. The value of mode must
be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><code class="literal">gtk.gdk.CLIP_BY_CHILDREN</code></span></p></td><td>only draw onto the window itself not the
subwindows.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.INCLUDE_INFERIORS</code></span></p></td><td>draw onto the window and child windows.</td></tr></tbody></table><p></p></div><div class="refsect2" title="gtk.gdk.GC.set_exposures"><a name="method-gdkgc--set-exposures"></a><h3>gtk.gdk.GC.set_exposures</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_exposures</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>exposures</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>exposures</code></strong> :</span></p></td><td>if <code class="literal">True</code> exposure events will
be generated for non-visible areas</td></tr></tbody></table><p>The <code class="methodname">set_exposures</code>() 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
<em class="parameter"><code>exposures</code></em> is <code class="literal">True</code> exposure events
will be generated for non-visible areas. See the <a class="link" href="class-gdkdrawable.html#method-gdkdrawable--draw-drawable" title="gtk.gdk.Drawable.draw_drawable"><code class="methodname">gtk.gdk.Drawable.draw_drawable</code>()</a>
method. </p></div><div class="refsect2" title="gtk.gdk.GC.set_line_attributes"><a name="method-gdkgc--set-line-attributes"></a><h3>gtk.gdk.GC.set_line_attributes</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_line_attributes</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>line_width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>line_style</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cap_style</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>join_style</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>line_width</code></strong> :</span></p></td><td>the new line width in
pixels</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>line_style</code></strong> :</span></p></td><td>the new line style</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>cap_style</code></strong> :</span></p></td><td>the new line end style</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>join_style</code></strong> :</span></p></td><td>the new line join style</td></tr></tbody></table><p>The <code class="methodname">set_line_attributes</code>() method sets
the attributes to be used when drawing a line using the graphics context to
the values specified by <em class="parameter"><code>line_width</code></em>,
<em class="parameter"><code>line_style</code></em>, <em class="parameter"><code>cap_style</code></em> and
<em class="parameter"><code>join_style</code></em>. The value of
<em class="parameter"><code>line_style</code></em> must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><code class="literal">gtk.gdk.LINE_SOLID</code></span></p></td><td>Lines are drawn solid.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.LINE_ON_OFF_DASH</code></span></p></td><td>Lines are drawn dashed where even segments are drawn
but odd segments are not drawn.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.LINE_DOUBLE_DASH</code></span></p></td><td>Lines are drawn dashed where even segments are drawn
normally but odd segments are drawn in the background color if the fill
style is <code class="literal">gtk.gdk.SOLID</code>, or in the background color masked
by the stipple if the fill style is
<code class="literal">gtk.gdk.STIPPLED</code>.</td></tr></tbody></table><p>The value of cap_style must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><code class="literal">gtk.gdk.CAP_NOT_LAST</code></span></p></td><td>The same as <code class="literal">gtk.gdk.CAP_BUTT</code> for
lines of non-zero width but for zero width lines, the final point on the
line will not be drawn.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.CAP_BUTT</code></span></p></td><td>The ends of the lines are drawn squared off and
extending to the coordinates of the end point.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.CAP_ROUND</code></span></p></td><td>The ends of the lines are drawn as semicircles with the
diameter equal to the line width and centered at the end point.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.CAP_PROJECTING</code></span></p></td><td>The ends of the lines are drawn squared off and
extending half the width of the line beyond the end point.</td></tr></tbody></table><p>The value of join_style must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><code class="literal">gtk.gdk.JOIN_MITER</code></span></p></td><td>The sides of each line are extended to meet at an
angle.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.JOIN_ROUND</code></span></p></td><td>The sides of the two lines are joined by a circular
arc.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.JOIN_BEVEL</code></span></p></td><td>The sides of the two lines are joined by a straight
line which makes an equal angle with each line.</td></tr></tbody></table><p></p></div><div class="refsect2" title="gtk.gdk.GC.set_dashes"><a name="method-gdkgc--set-dashes"></a><h3>gtk.gdk.GC.set_dashes</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_dashes</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>dash_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>dash_list</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>n</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>dash_offset</code></em> :</span></p></td><td>the index of the length in
<em class="parameter"><code>dash_list</code></em> to use as the firstst
dash</td></tr><tr><td><p><span class="term"><em class="parameter"><code>dash_list</code></em> :</span></p></td><td>the tuple or list of dash lengths in
pixels</td></tr></tbody></table><p>The <code class="methodname">set_dashes</code>() method sets the
pattern for drawing dashed lines using the tuple or list of dash lengths
specified by <em class="parameter"><code>dash_list</code></em> with the index of the starting
dash length specified by <em class="parameter"><code>dash_offset</code></em>. 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 <em class="parameter"><code>dash_list</code></em> numbers and
starting over when the end is reached. For example, if
<em class="parameter"><code>dash_list</code></em> 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.</p></div><div class="refsect2" title="gtk.gdk.GC.offset"><a name="method-gdkgc--offset"></a><h3>gtk.gdk.GC.offset</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">offset</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y_offset</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>x_offset</code></strong> :</span></p></td><td>the amount by which to offset the graphics context in the X
direction</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y_offset</code></strong> :</span></p></td><td>the amount by which to offset the graphics context in the Y
direction</td></tr></tbody></table><p>The <code class="methodname">offset</code>() method sets offset
attributes such as the clip and tile-stipple origins of the graphics context so that
drawing at x - <em class="parameter"><code>x_offset</code></em>, y -
<em class="parameter"><code>y_offset</code></em> with the offset graphics context has the same effect as
drawing at x, y with the original graphics context.</p></div><div class="refsect2" title="gtk.gdk.GC.copy"><a name="method-gdkgc--copy"></a><h3>gtk.gdk.GC.copy</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">copy</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>src_gc</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>src_gc</code></strong> :</span></p></td><td>the <a class="link" href="class-gdkgc.html" title="gtk.gdk.GC"><code class="classname">gtk.gdk.GC</code></a> to
copy</td></tr></tbody></table><p>The <code class="methodname">copy</code>() method copies the attributes
of the <a class="link" href="class-gdkgc.html" title="gtk.gdk.GC"><code class="classname">gtk.gdk.GC</code></a>
specified by <em class="parameter"><code>src_gc</code></em> into this graphics context.</p></div><div class="refsect2" title="gtk.gdk.GC.set_colormap"><a name="method-gdkgc--set-colormap"></a><h3>gtk.gdk.GC.set_colormap</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_colormap</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>colormap</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>colormap</code></strong> :</span></p></td><td>a <a class="link" href="class-gdkcolormap.html" title="gtk.gdk.Colormap"><code class="classname">gtk.gdk.Colormap</code></a></td></tr></tbody></table><p>The <code class="methodname">set_colormap</code>() method sets the
colormap for the graphics context to the specified
<em class="parameter"><code>colormap</code></em>. The depth of the colormap's visual must
match the depth of the drawable for which the graphics context was
created.</p></div><div class="refsect2" title="gtk.gdk.GC.get_colormap"><a name="method-gdkgc--get-colormap"></a><h3>gtk.gdk.GC.get_colormap</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_colormap</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the colormap used by the graphics
context</td></tr></tbody></table><p>The <code class="methodname">get_colormap</code>() 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 <a class="link" href="class-gdkgc.html#method-gdkgc--set-colormap" title="gtk.gdk.GC.set_colormap"><code class="methodname">set_colormap</code>()</a>
method.</p></div><div class="refsect2" title="gtk.gdk.GC.set_rgb_fg_color"><a name="method-gdkgc--set-rgb-fg-color"></a><h3>gtk.gdk.GC.set_rgb_fg_color</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_rgb_fg_color</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>color</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>color</code></strong> :</span></p></td><td>an unallocated <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a>.</td></tr></tbody></table><p>The <code class="methodname">set_rgb_fg_color</code>() method sets the
foreground color of a graphics context using the specified unallocated
<em class="parameter"><code>color</code></em>. The pixel value for
<em class="parameter"><code>color</code></em> 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.</p></div><div class="refsect2" title="gtk.gdk.GC.set_rgb_bg_color"><a name="method-gdkgc--set-rgb-bg-color"></a><h3>gtk.gdk.GC.set_rgb_bg_color</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_rgb_bg_color</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>color</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>color</code></strong> :</span></p></td><td>an unallocated <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a>.</td></tr></tbody></table><p>The <code class="methodname">set_rgb_bg_color</code>() method sets the
background color of a graphics context using the specified unallocated
<em class="parameter"><code>color</code></em>. The pixel value for
<em class="parameter"><code>color</code></em> 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.</p></div><div class="refsect2" title="gtk.gdk.GC.get_screen"><a name="method-gdkgc--get-screen"></a><h3>gtk.gdk.GC.get_screen</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_screen</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the <a class="link" href="class-gdkscreen.html" title="gtk.gdk.Screen"><code class="classname">gtk.gdk.Screen</code></a>
for the gc</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.2. and above.</p></div><p>The <code class="methodname">get_screen</code>() method returns the
<a class="link" href="class-gdkscreen.html" title="gtk.gdk.Screen"><code class="classname">gtk.gdk.Screen</code></a>
on which the gc was created.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gdkevent.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gdk-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-gdkimage.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.gdk.Event </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.gdk.Image</td></tr></table></div></body></html>
|