File: class-gdkgc.html

package info (click to toggle)
python-gtk2-doc 2.5.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,304 kB
  • ctags: 3,741
  • sloc: makefile: 38
file content (244 lines) | stat: -rw-r--r-- 65,341 bytes parent folder | download
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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.gdk.GC</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><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="previous" 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" lang="en"><a name="class-gdkgc"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.gdk.GC</h2><p>gtk.gdk.GC &#8212; objects to encapsulate drawing properties.</p></div><div class="refsect1" lang="en"><a name="id3073486"></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"><a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a></span></span>):
<code class="constructorsynopsis">    <span class="methodname"><a href="class-gdkgc.html#constructor-gdkgc" title="Constructor">gtk.gdk.GC</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>drawable</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>foreground</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>background</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>font</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>function</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>fill</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>tile</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>stipple</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>clip_mask</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>subwindow_mode</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>ts_x_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>ts_y_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>clip_x_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>clip_y_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>graphics_exposures</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>line_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>line_style</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cap_style</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>join_style</tt></b></span>&gt;</span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gdkgc.html#method-gdkgc--set-values" title="gtk.gdk.GC.set_values">set_values</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>foreground</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>background</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>font</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>function</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>fill</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>tile</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>stipple</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>clip_mask</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>subwindow_mode</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>ts_x_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>ts_y_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>clip_x_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>clip_y_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>graphics_exposures</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>line_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>line_style</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cap_style</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>join_style</tt></b></span>&gt;</span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gdkgc.html#method-gdkgc--set-foreground" title="gtk.gdk.GC.set_foreground">set_foreground</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>color</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gdkgc.html#method-gdkgc--set-background" title="gtk.gdk.GC.set_background">set_background</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>color</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gdkgc.html#method-gdkgc--set-function" title="gtk.gdk.GC.set_function">set_function</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>function</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gdkgc.html#method-gdkgc--set-fill" title="gtk.gdk.GC.set_fill">set_fill</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>fill</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gdkgc.html#method-gdkgc--set-tile" title="gtk.gdk.GC.set_tile">set_tile</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>tile</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gdkgc.html#method-gdkgc--set-stipple" title="gtk.gdk.GC.set_stipple">set_stipple</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>stipple</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>mask</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>rectangle</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gdkgc.html#method-gdkgc--set-subwindow" title="gtk.gdk.GC.set_subwindow">set_subwindow</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>mode</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gdkgc.html#method-gdkgc--set-exposures" title="gtk.gdk.GC.set_exposures">set_exposures</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>exposures</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>line_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>line_style</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cap_style</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>join_style</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gdkgc.html#method-gdkgc--set-dashes" title="gtk.gdk.GC.set_dashes">set_dashes</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>dash_offset</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>dash_list</tt></i></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gdkgc.html#method-gdkgc--offset" title="gtk.gdk.GC.offset">offset</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>x_offset</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y_offset</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gdkgc.html#method-gdkgc--copy" title="gtk.gdk.GC.copy">copy</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_gc</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gdkgc.html#method-gdkgc--set-colormap" title="gtk.gdk.GC.set_colormap">set_colormap</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>colormap</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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 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"><b class="parameter"><tt>color</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>color</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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" lang="en"><a name="id3006970"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
  +-- <a href="class-gdkgc.html" title="gtk.gdk.GC">gtk.gdk.GC</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3012815"></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><col><col></colgroup><tbody><tr valign="top"><td valign="top">"background"</td><td valign="top">Read-Write</td><td valign="top">The background <a href="class-gdkcolor.html" title="gtk.gdk.Color"><tt class="classname">gtk.gdk.Color</tt></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:
<tt class="literal">gtk.gdk.CAP_NOT_LAST</tt>,
<tt class="literal">gtk.gdk.CAP_BUTT</tt>, <tt class="literal">gtk.gdk.CAP_ROUND</tt> or
<tt class="literal">gtk.gdk.CAP_PROJECTING</tt>.</td></tr><tr valign="top"><td valign="top">"clip_mask"</td><td valign="top">Read-Write</td><td valign="top">A <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></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:
<tt class="literal">gtk.gdk.SOLID</tt>, <tt class="literal">gtk.gdk.TILED</tt>,
<tt class="literal">gtk.gdk.STIPPLED</tt> or
<tt class="literal">gtk.gdk.OPAQUE_STIPPLED</tt>.</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 href="class-gdkcolor.html" title="gtk.gdk.Color"><tt class="classname">gtk.gdk.Color</tt></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: <tt class="literal">gtk.gdk.COPY</tt>,
<tt class="literal">gtk.gdk.INVERT</tt>, <tt class="literal">gtk.gdk.XOR</tt>,
<tt class="literal">gtk.gdk.CLEAR</tt>, <tt class="literal">gtk.gdk.AND</tt>,
<tt class="literal">gtk.gdk.AND_REVERSE</tt>,
<tt class="literal">gtk.gdk.AND_INVERT</tt>, <tt class="literal">gtk.gdk.NOOP</tt>,
<tt class="literal">gtk.gdk.OR</tt>, <tt class="literal">gtk.gdk.EQUIV</tt>,
<tt class="literal">gtk.gdk.OR_REVERSE</tt>,
<tt class="literal">gtk.gdk.COPY_INVERT</tt>,
<tt class="literal">gtk.gdk.OR_INVERT</tt>, <tt class="literal">gtk.gdk.NAND</tt>,
<tt class="literal">gtk.gdk.NOR</tt> or <tt class="literal">gtk.gdk.SET</tt>.</td></tr><tr valign="top"><td valign="top">"graphics_exposures"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt> 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:
<tt class="literal">gtk.gdk.JOIN_MITER</tt>, <tt class="literal">gtk.gdk.JOIN_ROUND</tt>
or <tt class="literal">gtk.gdk.JOIN_BEVEL</tt>.</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:
<tt class="literal">gtk.gdk.LINE_SOLID</tt>,
<tt class="literal">gtk.gdk.LINE_ON_OFF_DASH</tt> or
<tt class="literal">gtk.gdk.LINE_DOUBLE_DASH</tt>.</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 href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></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 href="class-gdkwindow.html" title="gtk.gdk.Window"><tt class="classname">gtk.gdk.Window</tt></a> with
subwindows - one of: <tt class="literal">gtk.gdk.CLIP_BY_CHILDREN</tt> or
<tt class="literal">gtk.gdk.INCLUDE_INFERIORS</tt>.</td></tr><tr valign="top"><td valign="top">"tile"</td><td valign="top">Read-Write</td><td valign="top">The <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></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" lang="en"><a name="id2930213"></a><h2>Description</h2><p>All drawing operations in <tt class="literal">PyGTK</tt> take a graphics
context (<a href="class-gdkgc.html" title="gtk.gdk.GC"><tt class="classname">gtk.gdk.GC</tt></a>) argument
(See the <a href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><tt class="classname">gtk.gdk.Drawable</tt></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 href="class-gdkdrawable.html#method-gdkdrawable--new-gc" title="gtk.gdk.Drawable.new_gc"><tt class="methodname">gtk.gdk.Drawable.new_gc</tt>()</a>, 
or can be set one-by-one using functions such as <a href="class-gdkgc.html#method-gdkgc--set-foreground" title="gtk.gdk.GC.set_foreground"><tt class="methodname">set_foreground</tt>()</a> 
or by setting a <a href="class-gdkgc.html" title="gtk.gdk.GC"><tt class="classname">gtk.gdk.GC</tt></a> attribute. A
few of the values in the <a href="class-gdkgc.html" title="gtk.gdk.GC"><tt class="classname">gtk.gdk.GC</tt></a>, such as the
dash pattern, can only be set by the latter method.</p></div><div class="refsect1" lang="en"><a name="constructor-gdkgc"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.gdk.GC</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>drawable</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>foreground</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>background</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>font</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>function</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>fill</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>tile</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>stipple</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>clip_mask</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>subwindow_mode</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>ts_x_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>ts_y_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>clip_x_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>clip_y_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>graphics_exposures</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>line_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>line_style</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cap_style</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>join_style</tt></b></span>&gt;</span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>drawable</tt></b>:</span></td><td>A <a href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><tt class="classname">gtk.gdk.Drawable</tt></a>
(<a href="class-gdkwindow.html" title="gtk.gdk.Window"><tt class="classname">gtk.gdk.Window</tt></a> or
<a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a>)</td></tr><tr><td><span class="term"><b class="parameter"><tt>foreground</tt></b>:</span></td><td>the foreground <a href="class-gdkcolor.html" title="gtk.gdk.Color"><tt class="classname">gtk.gdk.Color</tt></a></td></tr><tr><td><span class="term"><b class="parameter"><tt>background</tt></b>:</span></td><td>the background <a href="class-gdkcolor.html" title="gtk.gdk.Color"><tt class="classname">gtk.gdk.Color</tt></a></td></tr><tr><td><span class="term"><b class="parameter"><tt>font</tt></b>:</span></td><td>a font (deprecated and
ignored)</td></tr><tr><td><span class="term"><b class="parameter"><tt>function</tt></b>:</span></td><td>the bitwise operator used to combine the existing
pixel value and a new pixel value - usually one of:
<tt class="literal">gtk.gdk.COPY</tt>, <tt class="literal">gtk.gdk.XOR</tt> or
<tt class="literal">gtk.gdk.INVERT</tt>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>fill</tt></b>:</span></td><td>the fill style - one of:
<tt class="literal">gtk.gdk.SOLID</tt>, <tt class="literal">gtk.gdk.TILED</tt>,
<tt class="literal">gtk.gdk.STIPPLED</tt>,
<tt class="literal">gtk.gdk.OPAQUE_STIPPLED</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>tile</tt></b>:</span></td><td>a <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a> used
for tiling the background</td></tr><tr><td><span class="term"><b class="parameter"><tt>stipple</tt></b>:</span></td><td>a <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a> used
for stippling the background</td></tr><tr><td><span class="term"><b class="parameter"><tt>clip_mask</tt></b>:</span></td><td>a <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a> of
depth 1 used to mask pixels to be drawn</td></tr><tr><td><span class="term"><b class="parameter"><tt>subwindow_mode</tt></b>:</span></td><td>the mode of drawing on subwindows in a <a href="class-gdkwindow.html" title="gtk.gdk.Window"><tt class="classname">gtk.gdk.Window</tt></a>
- one of: <tt class="literal">gtk.gdk.CLIP_BY_CHILDREN</tt> or
<tt class="literal">gtk.gdk.INCLUDE_INFERIORS</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>ts_x_origin</tt></b>:</span></td><td>the X coordinate of the origin of
<i class="parameter"><tt>tile</tt></i> or
<i class="parameter"><tt>stipple</tt></i></td></tr><tr><td><span class="term"><b class="parameter"><tt>ts_y_origin</tt></b>:</span></td><td>the Y coordinate of the origin of
<i class="parameter"><tt>tile</tt></i> or
<i class="parameter"><tt>stipple</tt></i></td></tr><tr><td><span class="term"><b class="parameter"><tt>clip_x_origin</tt></b>:</span></td><td>the X coordinate of the origin of
<i class="parameter"><tt>clip_mask</tt></i></td></tr><tr><td><span class="term"><b class="parameter"><tt>clip_y_origin</tt></b>:</span></td><td>the Y coordinate of the origin of
<i class="parameter"><tt>clip_mask</tt></i></td></tr><tr><td><span class="term"><b class="parameter"><tt>graphics_exposures</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> graphics exposures are
enabled for calls to the <a href="class-gdkdrawable.html#method-gdkdrawable--draw-drawable" title="gtk.gdk.Drawable.draw_drawable"><tt class="methodname">gtk.gdk.Drawable.draw_drawable</tt>()</a> 
method.</td></tr><tr><td><span class="term"><b class="parameter"><tt>line_width</tt></b>:</span></td><td>the line width in pixels</td></tr><tr><td><span class="term"><b class="parameter"><tt>line_style</tt></b>:</span></td><td>the line style - one of:
<tt class="literal">gtk.gdk.LINE_SOLID</tt>,
<tt class="literal">gtk.gdk.LINE_ON_OFF_DASH</tt>,
<tt class="literal">gtk.gdk.LINE_DOUBLE_DASH</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>cap_style</tt></b>:</span></td><td>the style of line ends - one of:
<tt class="literal">gtk.gdk.CAP_NOT_LAST</tt>,
<tt class="literal">gtk.gdk.CAP_BUTT</tt>, <tt class="literal">gtk.gdk.CAP_ROUND</tt>,
<tt class="literal">gtk.gdk.CAP_PROJECTING</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>join_style</tt></b>:</span></td><td>the style of line joins - one of:
<tt class="literal">gtk.gdk.JOIN_MITER</tt>,
<tt class="literal">gtk.gdk.JOIN_ROUND</tt>,
<tt class="literal">gtk.gdk.JOIN_BEVEL</tt></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gdkgc.html" title="gtk.gdk.GC"><tt class="classname">gtk.gdk.GC</tt></a>
object</td></tr></tbody></table><p>Creates a new <a href="class-gdkgc.html" title="gtk.gdk.GC"><tt class="classname">gtk.gdk.GC</tt></a> object for
the <a href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><tt class="classname">gtk.gdk.Drawable</tt></a>
specified by <i class="parameter"><tt>drawable</tt></i> 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 href="class-gdkdrawable.html#method-gdkdrawable--new-gc" title="gtk.gdk.Drawable.new_gc"><tt class="methodname">gtk.gdk.Drawable.new_gc</tt>()</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" lang="en"><a name="id3204013"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gdkgc--set-values"></a><h3>gtk.gdk.GC.set_values</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_values</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>values</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>foreground</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>background</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>font</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>function</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>fill</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>tile</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>stipple</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>clip_mask</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>subwindow_mode</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>ts_x_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>ts_y_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>clip_x_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>clip_y_origin</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>graphics_exposures</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>line_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>line_style</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cap_style</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>join_style</tt></b></span>&gt;</span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>foreground</tt></b>:</span></td><td>the foreground <a href="class-gdkcolor.html" title="gtk.gdk.Color"><tt class="classname">gtk.gdk.Color</tt></a></td></tr><tr><td><span class="term"><b class="parameter"><tt>background</tt></b>:</span></td><td>the background <a href="class-gdkcolor.html" title="gtk.gdk.Color"><tt class="classname">gtk.gdk.Color</tt></a></td></tr><tr><td><span class="term"><b class="parameter"><tt>font</tt></b>:</span></td><td>a font (deprecated and
ignored)</td></tr><tr><td><span class="term"><b class="parameter"><tt>function</tt></b>:</span></td><td>the bitwise operator used to combine the
existing pixel value and a new pixel value - usually one of:
<tt class="literal">gtk.gdk.COPY</tt>, <tt class="literal">gtk.gdk.XOR</tt> or
<tt class="literal">gtk.gdk.INVERT</tt>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>fill</tt></b>:</span></td><td>the fill style - one of:
<tt class="literal">gtk.gdk.SOLID</tt>, <tt class="literal">gtk.gdk.TILED</tt>,
<tt class="literal">gtk.gdk.STIPPLED</tt>,
<tt class="literal">gtk.gdk.OPAQUE_STIPPLED</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>tile</tt></b>:</span></td><td>a <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a> used
for tiling the background</td></tr><tr><td><span class="term"><b class="parameter"><tt>stipple</tt></b>:</span></td><td>a <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a> used
for stippling the background</td></tr><tr><td><span class="term"><b class="parameter"><tt>clip_mask</tt></b>:</span></td><td>a <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a> of
depth 1 used to mask pixels to be drawn</td></tr><tr><td><span class="term"><b class="parameter"><tt>subwindow_mode</tt></b>:</span></td><td>the mode of drawing on subwindows in a
<a href="class-gdkwindow.html" title="gtk.gdk.Window"><tt class="classname">gtk.gdk.Window</tt></a> - one of: <tt class="literal">gtk.gdk.CLIP_BY_CHILDREN</tt> or
<tt class="literal">gtk.gdk.INCLUDE_INFERIORS</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>ts_x_origin</tt></b>:</span></td><td>the X coordinate of the origin of
<i class="parameter"><tt>tile</tt></i> or
<i class="parameter"><tt>stipple</tt></i></td></tr><tr><td><span class="term"><b class="parameter"><tt>ts_y_origin</tt></b>:</span></td><td>the Y coordinate of the origin of
<i class="parameter"><tt>tile</tt></i> or
<i class="parameter"><tt>stipple</tt></i></td></tr><tr><td><span class="term"><b class="parameter"><tt>clip_x_origin</tt></b>:</span></td><td>the X coordinate of the origin of
<i class="parameter"><tt>clip_mask</tt></i></td></tr><tr><td><span class="term"><b class="parameter"><tt>clip_y_origin</tt></b>:</span></td><td>the Y coordinate of the origin of
<i class="parameter"><tt>clip_mask</tt></i></td></tr><tr><td><span class="term"><b class="parameter"><tt>graphics_exposures</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> graphics exposures
are enabled for calls to the <a href="class-gdkdrawable.html#method-gdkdrawable--draw-drawable" title="gtk.gdk.Drawable.draw_drawable"><tt class="methodname">gtk.gdk.Drawable.draw_drawable</tt>()</a> 
method.</td></tr><tr><td><span class="term"><b class="parameter"><tt>line_width</tt></b>:</span></td><td>the line width in pixels</td></tr><tr><td><span class="term"><b class="parameter"><tt>line_style</tt></b>:</span></td><td>the line style - one of:
<tt class="literal">gtk.gdk.LINE_SOLID</tt>,
<tt class="literal">gtk.gdk.LINE_ON_OFF_DASH</tt>,
<tt class="literal">gtk.gdk.LINE_DOUBLE_DASH</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>cap_style</tt></b>:</span></td><td>the style of line ends - one of:
<tt class="literal">gtk.gdk.CAP_NOT_LAST</tt>,
<tt class="literal">gtk.gdk.CAP_BUTT</tt>, <tt class="literal">gtk.gdk.CAP_ROUND</tt>,
<tt class="literal">gtk.gdk.CAP_PROJECTING</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>join_style</tt></b>:</span></td><td>the style of line joins - one of:
<tt class="literal">gtk.gdk.JOIN_MITER</tt>,
<tt class="literal">gtk.gdk.JOIN_ROUND</tt>,
<tt class="literal">gtk.gdk.JOIN_BEVEL</tt></td></tr></tbody></table><p>The <tt class="methodname">set_values</tt>() 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" lang="en"><a name="method-gdkgc--set-foreground"></a><h3>gtk.gdk.GC.set_foreground</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_foreground</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>color</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>color</tt></b>:</span></td><td>the new foreground <a href="class-gdkcolor.html" title="gtk.gdk.Color"><tt class="classname">gtk.gdk.Color</tt></a></td></tr></tbody></table><p>The <tt class="methodname">set_foreground</tt>() method sets the
foreground <a href="class-gdkcolor.html" title="gtk.gdk.Color"><tt class="classname">gtk.gdk.Color</tt></a> to the
value specified by <i class="parameter"><tt>color</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-gdkgc--set-background"></a><h3>gtk.gdk.GC.set_background</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_background</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>color</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>color</tt></b>:</span></td><td>the new background <a href="class-gdkcolor.html" title="gtk.gdk.Color"><tt class="classname">gtk.gdk.Color</tt></a></td></tr></tbody></table><p>The <tt class="methodname">set_background</tt>() method sets the
background <a href="class-gdkcolor.html" title="gtk.gdk.Color"><tt class="classname">gtk.gdk.Color</tt></a> to the
value specified by <i class="parameter"><tt>color</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-gdkgc--set-function"></a><h3>gtk.gdk.GC.set_function</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_function</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>function</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>function</tt></b>:</span></td><td>the bitwise operator used to combine the
existing pixel value and a new pixel value - usually one of:
<tt class="literal">gtk.gdk.COPY</tt>, <tt class="literal">gtk.gdk.XOR</tt> or
<tt class="literal">gtk.gdk.INVERT</tt>.</td></tr></tbody></table><p>The <tt class="methodname">set_function</tt>() method sets the
function attribute to the value specified by
<i class="parameter"><tt>function</tt></i>. The value of
<i class="parameter"><tt>function</tt></i> must be one of:</p><div class="itemizedlist"><ul type="disc"><li><tt class="literal">gtk.gdk.COPY</tt></li><li><tt class="literal">gtk.gdk.INVERT</tt></li><li><tt class="literal">gtk.gdk.XOR</tt></li><li><tt class="literal">gtk.gdk.CLEAR</tt></li><li><tt class="literal">gtk.gdk.AND</tt></li><li><tt class="literal">gtk.gdk.AND_REVERSE.</tt></li><li><tt class="literal">gtk.gdk.AND_INVERT</tt></li><li><tt class="literal">gtk.gdk.NOOP</tt></li><li><tt class="literal">gtk.gdk.OR</tt></li><li><tt class="literal">gtk.gdk.EQUIV</tt></li><li><tt class="literal">gtk.gdk.OR_REVERSE</tt></li><li><tt class="literal">gtk.gdk.COPY_INVERT</tt></li><li><tt class="literal">gtk.gdk.OR_INVERT</tt></li><li><tt class="literal">gtk.gdk.NAND</tt></li><li><tt class="literal">gtk.gdk.NOR</tt></li><li><tt class="literal">gtk.gdk.SET</tt></li></ul></div><p>Only a couple of these values are usually useful. For colored
images, only <tt class="literal">gtk.gdk.COPY</tt>, <tt class="literal">gtk.gdk.XOR</tt>
and <tt class="literal">gtk.gdk.INVERT</tt> are generally useful. For bitmaps,
<tt class="literal">gtk.gdk.AND</tt> and <tt class="literal">gtk.gdk.OR</tt> are also
useful. </p></div><div class="refsect2" lang="en"><a name="method-gdkgc--set-fill"></a><h3>gtk.gdk.GC.set_fill</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_fill</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>fill</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>fill</tt></b>:</span></td><td>the new fill mode</td></tr></tbody></table><p>The <tt class="methodname">set_fill</tt>() method sets the fill
mode for the graphics context to the value specified by
<i class="parameter"><tt>fill</tt></i>. The value of <i class="parameter"><tt>fill</tt></i> must
be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><tt class="literal">gtk.gdk.SOLID</tt></span></td><td>draw with the foreground color. </td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.TILED</tt></span></td><td>draw with a tiled pixmap.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.STIPPLED</tt></span></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><span class="term"><tt class="literal">gtk.gdk.OPAQUE_STIPPLED</tt></span></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" lang="en"><a name="method-gdkgc--set-tile"></a><h3>gtk.gdk.GC.set_tile</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_tile</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>tile</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>tile</tt></b>:</span></td><td>a <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a></td></tr></tbody></table><p>The <tt class="methodname">set_tile</tt>() method sets the <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a>
specified by <i class="parameter"><tt>tile</tt></i> to be used for filling the
background when the fill mode is <tt class="literal">gtk.gdk.TILED</tt>.</p></div><div class="refsect2" lang="en"><a name="method-gdkgc--set-stipple"></a><h3>gtk.gdk.GC.set_stipple</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_stipple</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>stipple</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>stipple</tt></b>:</span></td><td>a <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a> bitmap</td></tr></tbody></table><p>The <tt class="methodname">set_stipple</tt>() method sets the <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a>
bitmap specified by <i class="parameter"><tt>stipple</tt></i> to be used for stippling
the background. <i class="parameter"><tt>stipple</tt></i> will only be used if the fill
mode is <tt class="literal">gtk.gdk.STIPPLED</tt> or
<tt class="literal">gtk.gdk.OPAQUE_STIPPLED</tt>.</p></div><div class="refsect2" lang="en"><a name="method-gdkgc--set-ts-origin"></a><h3>gtk.gdk.GC.set_ts_origin</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_ts_origin</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>x</tt></b>:</span></td><td>the x origin of the tile or
stipple</td></tr><tr><td><span class="term"><b class="parameter"><tt>y</tt></b>:</span></td><td>the y origin of the tile or
stipple</td></tr></tbody></table><p>The <tt class="methodname">set_ts_origin</tt>() method sets the
origin of the tile or stipple to the value specified by
<i class="parameter"><tt>x</tt></i> and <i class="parameter"><tt>y</tt></i>. 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" lang="en"><a name="method-gdkgc--set-clip-origin"></a><h3>gtk.gdk.GC.set_clip_origin</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_clip_origin</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>x</tt></b>:</span></td><td>the x origin of the clip
mask</td></tr><tr><td><span class="term"><b class="parameter"><tt>y</tt></b>:</span></td><td>the y origin of the clip
mask</td></tr></tbody></table><p>The <tt class="methodname">set_clip_origin</tt>() method sets the
origin of the clip mask to the value specified by <i class="parameter"><tt>x</tt></i>
and <i class="parameter"><tt>y</tt></i>. The coordinates are interpreted relative to
the upper-left corner of the destination drawable of the current
operation.</p></div><div class="refsect2" lang="en"><a name="method-gdkgc--set-clip-mask"></a><h3>gtk.gdk.GC.set_clip_mask</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_clip_mask</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>mask</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>mask</tt></b>:</span></td><td>a <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a></td></tr></tbody></table><p>The <tt class="methodname">set_clip_mask</tt>() method sets the
clip mask (a <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a> bit
map) to the value specified by <i class="parameter"><tt>mask</tt></i>. The clip mask is
interpreted relative to the clip origin. See the <a href="class-gdkgc.html#method-gdkgc--set-clip-origin" title="gtk.gdk.GC.set_clip_origin"><tt class="methodname">set_clip_origin</tt>()</a>
method.</p></div><div class="refsect2" lang="en"><a name="method-gdkgc--set-clip-rectangle"></a><h3>gtk.gdk.GC.set_clip_rectangle</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_clip_rectangle</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>rectangle</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>rectangle</tt></b>:</span></td><td>a
<a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
to use for clipping</td></tr></tbody></table><p>The <tt class="methodname">set_clip_rectangle</tt>() method sets
the clip mask for the graphics context from the <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
specified by <i class="parameter"><tt>rectangle</tt></i> and sets the clip origin to
(0, 0). The clip origin can be changed using the <a href="class-gdkgc.html#method-gdkgc--set-clip-origin" title="gtk.gdk.GC.set_clip_origin"><tt class="methodname">set_clip_origin</tt>()</a>
method.</p></div><div class="refsect2" lang="en"><a name="method-gdkgc--set-subwindow"></a><h3>gtk.gdk.GC.set_subwindow</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_subwindow</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>mode</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>mode</tt></b>:</span></td><td>the new subwindow mode</td></tr></tbody></table><p>The <tt class="methodname">set_subwindow</tt>() method sets the
mode of drawing on subwindows when drawing on a <a href="class-gdkwindow.html" title="gtk.gdk.Window"><tt class="classname">gtk.gdk.Window</tt></a> to
the value specified by <i class="parameter"><tt>mode</tt></i>. 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><span class="term"><tt class="literal">gtk.gdk.CLIP_BY_CHILDREN</tt></span></td><td>only draw onto the window itself not the
subwindows.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INCLUDE_INFERIORS</tt></span></td><td>draw onto the window and child windows.</td></tr></tbody></table><p></p></div><div class="refsect2" lang="en"><a name="method-gdkgc--set-exposures"></a><h3>gtk.gdk.GC.set_exposures</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_exposures</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>exposures</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>exposures</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> exposure events will
be generated for non-visible areas</td></tr></tbody></table><p>The <tt class="methodname">set_exposures</tt>() 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
<i class="parameter"><tt>exposures</tt></i> is <tt class="literal">TRUE</tt> exposure events
will be generated for non-visible areas. See the <a href="class-gdkdrawable.html#method-gdkdrawable--draw-drawable" title="gtk.gdk.Drawable.draw_drawable"><tt class="methodname">gtk.gdk.Drawable.draw_drawable</tt>()</a> 
method. </p></div><div class="refsect2" lang="en"><a name="method-gdkgc--set-line-attributes"></a><h3>gtk.gdk.GC.set_line_attributes</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_line_attributes</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>line_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>line_style</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cap_style</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>join_style</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>line_width</tt></b>:</span></td><td>the new line width in
pixels</td></tr><tr><td><span class="term"><b class="parameter"><tt>line_style</tt></b>:</span></td><td>the new line style</td></tr><tr><td><span class="term"><b class="parameter"><tt>cap_style</tt></b>:</span></td><td>the new line end style</td></tr><tr><td><span class="term"><b class="parameter"><tt>join_style</tt></b>:</span></td><td>the new line join style</td></tr></tbody></table><p>The <tt class="methodname">set_line_attributes</tt>() method sets
the attributes to be used when drawing a line using the graphics context to
the values specified by <i class="parameter"><tt>line_width</tt></i>,
<i class="parameter"><tt>line_style</tt></i>, <i class="parameter"><tt>cap_style</tt></i> and
<i class="parameter"><tt>join_style</tt></i>. The value of
<i class="parameter"><tt>line_style</tt></i> must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><tt class="literal">gtk.gdk.LINE_SOLID</tt></span></td><td>Lines are drawn solid.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.LINE_ON_OFF_DASH</tt></span></td><td>Lines are drawn dashed where even segments are drawn
but odd segments are not drawn.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.LINE_DOUBLE_DASH</tt></span></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 <tt class="literal">gtk.gdk.SOLID</tt>, or in the background color masked
by the stipple if the fill style is
<tt class="literal">gtk.gdk.STIPPLED</tt>.</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><span class="term"><tt class="literal">gtk.gdk.CAP_NOT_LAST</tt></span></td><td>The same as <tt class="literal">gtk.gdk.CAP_BUTT</tt> 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><span class="term"><tt class="literal">gtk.gdk.CAP_BUTT</tt></span></td><td>The ends of the lines are drawn squared off and
extending to the coordinates of the end point.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.CAP_ROUND</tt></span></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><span class="term"><tt class="literal">gtk.gdk.CAP_PROJECTING</tt></span></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><span class="term"><tt class="literal">gtk.gdk.JOIN_MITER</tt></span></td><td>The sides of each line are extended to meet at an
angle.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.JOIN_ROUND</tt></span></td><td>The sides of the two lines are joined by a circular
arc.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.JOIN_BEVEL</tt></span></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" lang="en"><a name="method-gdkgc--set-dashes"></a><h3>gtk.gdk.GC.set_dashes</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_dashes</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>dash_offset</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dash_list</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>n</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>dash_offset</tt></i>:</span></td><td>the index of the length in
<i class="parameter"><tt>dash_list</tt></i> to use as the firstst
dash</td></tr><tr><td><span class="term"><i class="parameter"><tt>dash_list</tt></i>:</span></td><td>the tuple or list of dash lengths in
pixels</td></tr></tbody></table><p>The <tt class="methodname">set_dashes</tt>() method sets the
pattern for drawing dashed lines using the tuple or list of dash lengths
specified by <i class="parameter"><tt>dash_list</tt></i> with the index of the starting
dash length specified by <i class="parameter"><tt>dash_offset</tt></i>. 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 <i class="parameter"><tt>dash_list</tt></i> numbers and
starting over when the end is reached. For example, if
<i class="parameter"><tt>dash_list</tt></i> 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" lang="en"><a name="method-gdkgc--offset"></a><h3>gtk.gdk.GC.offset</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">offset</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>x_offset</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y_offset</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>x_offset</tt></b>:</span></td><td>the amount by which to offset the graphics context in the X
direction</td></tr><tr><td><span class="term"><b class="parameter"><tt>y_offset</tt></b>:</span></td><td>the amount by which to offset the graphics context in the Y
direction</td></tr></tbody></table><p>The <tt class="methodname">offset</tt>() method sets offset
attributes such as the clip and tile-stipple origins of the graphics context so that
drawing at x - <i class="parameter"><tt>x_offset</tt></i>, y -
<i class="parameter"><tt>y_offset</tt></i> with the offset graphics context  has the same effect as
drawing at x, y with the original graphics context.</p></div><div class="refsect2" lang="en"><a name="method-gdkgc--copy"></a><h3>gtk.gdk.GC.copy</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">copy</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_gc</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>src_gc</tt></b>:</span></td><td>the <a href="class-gdkgc.html" title="gtk.gdk.GC"><tt class="classname">gtk.gdk.GC</tt></a> to
copy</td></tr></tbody></table><p>The <tt class="methodname">copy</tt>() method copies the attributes
of the <a href="class-gdkgc.html" title="gtk.gdk.GC"><tt class="classname">gtk.gdk.GC</tt></a>
specified by <i class="parameter"><tt>src_gc</tt></i> into this graphics context.</p></div><div class="refsect2" lang="en"><a name="method-gdkgc--set-colormap"></a><h3>gtk.gdk.GC.set_colormap</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_colormap</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>colormap</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>colormap</tt></b>:</span></td><td>a <a href="class-gdkcolormap.html" title="gtk.gdk.Colormap"><tt class="classname">gtk.gdk.Colormap</tt></a></td></tr></tbody></table><p>The <tt class="methodname">set_colormap</tt>() method sets the
colormap for the graphics context to the specified
<i class="parameter"><tt>colormap</tt></i>. 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" lang="en"><a name="method-gdkgc--get-colormap"></a><h3>gtk.gdk.GC.get_colormap</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_colormap</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the colormap used by the graphics
context</td></tr></tbody></table><p>The <tt class="methodname">get_colormap</tt>() 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 href="class-gdkgc.html#method-gdkgc--set-colormap" title="gtk.gdk.GC.set_colormap"><tt class="methodname">set_colormap</tt>()</a> 
method.</p></div><div class="refsect2" lang="en"><a name="method-gdkgc--set-rgb-fg-color"></a><h3>gtk.gdk.GC.set_rgb_fg_color</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_rgb_fg_color</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>color</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>color</tt></b>:</span></td><td>an unallocated <a href="class-gdkcolor.html" title="gtk.gdk.Color"><tt class="classname">gtk.gdk.Color</tt></a>.</td></tr></tbody></table><p>The <tt class="methodname">set_rgb_fg_color</tt>() method sets the
foreground color of a graphics context using the specified unallocated
<i class="parameter"><tt>color</tt></i>. The pixel value for
<i class="parameter"><tt>color</tt></i> 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" lang="en"><a name="method-gdkgc--set-rgb-bg-color"></a><h3>gtk.gdk.GC.set_rgb_bg_color</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_rgb_bg_color</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>color</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>color</tt></b>:</span></td><td>an unallocated <a href="class-gdkcolor.html" title="gtk.gdk.Color"><tt class="classname">gtk.gdk.Color</tt></a>.</td></tr></tbody></table><p>The <tt class="methodname">set_rgb_bg_color</tt>() method sets the
background color of a graphics context using the specified unallocated
<i class="parameter"><tt>color</tt></i>. The pixel value for
<i class="parameter"><tt>color</tt></i> 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" lang="en"><a name="method-gdkgc--get-screen"></a><h3>gtk.gdk.GC.get_screen</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_screen</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the <a href="class-gdkscreen.html" title="gtk.gdk.Screen"><tt class="classname">gtk.gdk.Screen</tt></a>
	  for the gc</td></tr></tbody></table><div class="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 <tt class="methodname">get_screen</tt>() method returns the
<a href="class-gdkscreen.html" title="gtk.gdk.Screen"><tt class="classname">gtk.gdk.Screen</tt></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>