File: gobject-functions.html

package info (click to toggle)
pygobject 2.14.2-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,732 kB
  • ctags: 1,489
  • sloc: ansic: 11,090; sh: 9,052; xml: 3,391; python: 2,565; makefile: 351
file content (348 lines) | stat: -rw-r--r-- 82,593 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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gobject Functions</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="PyGObject Reference Manual"><link rel="up" href="gobject-class-reference.html" title="The gobject Class Reference"><link rel="prev" href="class-gobjectmainloop.html" title="gobject.MainLoop"><link rel="next" href="gobject-constants.html" title="gobject Constants"></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">gobject Functions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gobjectmainloop.html">Prev</a> </td><th width="60%" align="center">The gobject Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="gobject-constants.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="gobject-functions"></a><div class="titlepage"></div><div class="refnamediv"><h2>gobject Functions</h2><p>gobject Functions — miscellaneous functions</p></div><div class="refsect1" lang="en"><a name="id2637941"></a><h2>Synopsis</h2><pre class="programlisting">
<code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--type-name" title="gobject.type_name">gobject.type_name</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--type-from-name" title="gobject.type_from_name">gobject.type_from_name</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type_name</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--type-parent" title="gobject.type_parent">gobject.type_parent</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--type-is-a" title="gobject.type_is_a">gobject.type_is_a</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>parent_type</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--type-children" title="gobject.type_children">gobject.type_children</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--type-interfaces" title="gobject.type_interfaces">gobject.type_interfaces</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--type-register" title="gobject.type_register">gobject.type_register</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>class</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--signal-new" title="gobject.signal_new">gobject.signal_new</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>signal_name</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>flags</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>return_type</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>param_types</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--signal-list-names" title="gobject.signal_list_names">gobject.signal_list_names</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--signal-list-ids" title="gobject.signal_list_ids">gobject.signal_list_ids</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--signal-lookup" title="gobject.signal_lookup">gobject.signal_lookup</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--signal-name" title="gobject.signal_name">gobject.signal_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>signal_id</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--signal-query1" title="gobject.signal_query">gobject.signal_query</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--signal-query2" title="gobject.signal_query">gobject.signal_query</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>signal_id</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--list-properties" title="gobject.list_properties">gobject.list_properties</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--new" title="gobject.new">gobject.new</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--idle-add" title="gobject.idle_add">gobject.idle_add</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>callback</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--timeout-add" title="gobject.timeout_add">gobject.timeout_add</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>interval</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>callback</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--io-add-watch" title="gobject.io_add_watch">gobject.io_add_watch</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>fd</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>condition</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>callback</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--source-remove" title="gobject.source_remove">gobject.source_remove</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>tag</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--main-context-default" title="gobject.main_context_default">gobject.main_context_default</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--markup-escape-text" title="gobject.markup_escape_text">gobject.markup_escape_text</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>text</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--child-watch-add" title="gobject.child_watch_add">gobject.child_watch_add</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>pid</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>data</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>priority</code></strong></span><span class="initializer">=gobject.PRIORITY_DEFAULT</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--spawn-async" title="gobject.spawn_async">gobject.spawn_async</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>argv</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>envp</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>working_directory</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>flags</code></strong></span><span class="initializer">=0</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>child_setup</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>user_data</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>standard_input</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>standard_output</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>standard_error</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--get-current-time" title="gobject.get_current_time">gobject.get_current_time</a></span>()</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--main-depth" title="gobject.main_depth">gobject.main_depth</a></span>()</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--threads-init" title="gobject.threads_init">gobject.threads_init</a></span>()</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--signal-accumulator-true-handled" title="gobject.signal_accumulator_true_handled">gobject.signal_accumulator_true_handled</a></span>()</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--add-emission-hook" title="gobject.add_emission_hook">gobject.add_emission_hook</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>name</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>callback</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--remove-emission-hook" title="gobject.remove_emission_hook">gobject.remove_emission_hook</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>name</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>hook_id</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject---install-metaclass" title="gobject._install_metaclass">gobject._install_metaclass</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>metaclass</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--filename-display-name" title="gobject.filename_display_name">gobject.filename_display_name</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>filename</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--filename-display-basename" title="gobject.filename_display_basename">gobject.filename_display_basename</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>filename</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="gobject-functions.html#function-gobject--filename-from-utf8" title="gobject.filename_from_utf8">gobject.filename_from_utf8</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>utf8string</code></em></span></span>)</code></pre></div><div class="refsect1" lang="en"><a name="id2614517"></a><h2>Description</h2><p>These functions are part of the <code class="literal">PyGTK</code> gobject
module but are not directly associated with a specific class.</p></div><div class="refsect1" lang="en"><a name="id2644543"></a><h2>Functions</h2><div class="refsect2" lang="en"><a name="function-gobject--type-name"></a><h3>gobject.type_name</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.type_name</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></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>type</code></em> :</span></p></td><td>a GObject type, type ID or
instance</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td></td></tr></tbody></table><p>The <code class="function">gobject.type_name</code>() function returns
the unique name that is assigned to the specified
<em class="parameter"><code>type</code></em>. <em class="parameter"><code>type</code></em> can be a GObject
type, type ID or instance. This function raises a TypeError exception
if <em class="parameter"><code>type</code></em> isn't a <code class="literal">PyGTK</code> type.</p></div><div class="refsect2" lang="en"><a name="function-gobject--type-from-name"></a><h3>gobject.type_from_name</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.type_from_name</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type_name</code></em></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>type_name</code></em> :</span></p></td><td>a string containing the name of a
type</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the type ID named
<em class="parameter"><code>type_name</code></em></td></tr></tbody></table><p>The <code class="function">gobject.type_from_name</code>() function
returns the type ID of the <code class="literal">PyGTK</code> type with the name
specified by <em class="parameter"><code>type_name</code></em>. This function raises a
RuntimeError exception if no type matches
<em class="parameter"><code>type_name</code></em>.</p></div><div class="refsect2" lang="en"><a name="function-gobject--type-parent"></a><h3>gobject.type_parent</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.type_parent</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></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>type</code></em> :</span></p></td><td>a GObject type, type ID or
instance</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the parent type ID</td></tr></tbody></table><p>The <code class="function">gobject.type_parent</code>() function returns
the direct parent type ID of the specified <em class="parameter"><code>type</code></em>.
<em class="parameter"><code>type</code></em> can be a GObject type, type ID or instance. If
<em class="parameter"><code>type</code></em> has no parent, i.e. is a fundamental type, the
RuntimeError exception is raised. </p></div><div class="refsect2" lang="en"><a name="function-gobject--type-is-a"></a><h3>gobject.type_is_a</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.type_is_a</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>parent_type</code></em></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>type</code></em> :</span></p></td><td>a GObject type, type ID or
instance</td></tr><tr><td><p><span class="term"><em class="parameter"><code>parent_type</code></em> :</span></p></td><td>a GObject type, type ID or
instance</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">TRUE</code> if
<em class="parameter"><code>parent_type</code></em> is an ancestor of
<em class="parameter"><code>type</code></em></td></tr></tbody></table><p>The <code class="function">gobject.type_is_a</code>() function returns
<code class="literal">TRUE</code> if the specified <em class="parameter"><code>type</code></em> is a
descendant of the type specified by <em class="parameter"><code>parent_type</code></em>. This
function also returns <code class="literal">TRUE</code> if
<em class="parameter"><code>parent_type</code></em> is an interface and
<em class="parameter"><code>type</code></em> conforms to it.</p></div><div class="refsect2" lang="en"><a name="function-gobject--type-children"></a><h3>gobject.type_children</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.type_children</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></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>type</code></em> :</span></p></td><td>a GObject type, type ID or
instance</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a list of the child types of
<em class="parameter"><code>type</code></em></td></tr></tbody></table><p>The <code class="function">gobject.type_children</code>() function
returns a list containing the child types of the specified
<em class="parameter"><code>type</code></em>.</p></div><div class="refsect2" lang="en"><a name="function-gobject--type-interfaces"></a><h3>gobject.type_interfaces</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.type_interfaces</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></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>type</code></em> :</span></p></td><td>a GObject type, type ID or
instance</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a list of the interface types supported by
<em class="parameter"><code>type</code></em></td></tr></tbody></table><p>The <code class="function">gobject.type_interfaces</code>() function
returns a list of the interface types supported by
<em class="parameter"><code>type</code></em>. <em class="parameter"><code>type</code></em> can be a GObject
type, type ID or instance. This function returns a RuntimeError exception if
type is not a valid type or has no interfaces.</p></div><div class="refsect2" lang="en"><a name="function-gobject--type-register"></a><h3>gobject.type_register</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.type_register</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>class</code></em></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>class</code></em> :</span></p></td><td>a Python class that is a descendant of <a class="link" href="class-gobject.html" title="gobject.GObject"><code class="classname">gobject.GObject</code></a></td></tr></tbody></table><p>The <code class="function">gobject.type_register</code>() function
registers the specified Python <em class="parameter"><code>class</code></em> as a PyGTK type.
class must be a descendant of <a class="link" href="class-gobject.html" title="gobject.GObject"><code class="classname">gobject.GObject</code></a>. The function generates a name for the new type.</p></div><div class="refsect2" lang="en"><a name="function-gobject--signal-new"></a><h3>gobject.signal_new</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.signal_new</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>signal_name</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>flags</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>return_type</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>param_types</code></em></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>signal_name</code></em> :</span></p></td><td>a string containing the name of the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td><td>the object type that the signal is associated
with</td></tr><tr><td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td><td>the signal flags</td></tr><tr><td><p><span class="term"><em class="parameter"><code>return_type</code></em> :</span></p></td><td>the return type of the signal
handler</td></tr><tr><td><p><span class="term"><em class="parameter"><code>param_types</code></em> :</span></p></td><td>the parameter types passed to the signal
handler</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a unique integer signal ID</td></tr></tbody></table><p>The <code class="function">gobject.signal_new</code>() function registers
a signal with the specified <em class="parameter"><code>signal_name</code></em> for the
specified object <em class="parameter"><code>type</code></em>. The value of
<em class="parameter"><code>flags</code></em> is a combination 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">gobject.SIGNAL_RUN_FIRST</code></span></p></td><td>Invoke the object method handler in the first emission
stage. </td></tr><tr><td><p><span class="term"><code class="literal">gobject.SIGNAL_RUN_LAST</code></span></p></td><td>Invoke the object method handler in the third emission
stage.</td></tr><tr><td><p><span class="term"><code class="literal">gobject.SIGNAL_RUN_CLEANUP</code></span></p></td><td>Invoke the object method handler in the last emission
stage.</td></tr><tr><td><p><span class="term"><code class="literal">gobject.SIGNAL_NO_RECURSE</code></span></p></td><td>Signals being emitted for an object while currently
being in emission for this very object will not be emitted recursively, but
instead cause the first emission to be restarted.</td></tr><tr><td><p><span class="term"><code class="literal">gobject.SIGNAL_DETAILED</code></span></p></td><td>This signal supports "::detail" appendixes to the
signal name upon handler connections and emissions.</td></tr><tr><td><p><span class="term"><code class="literal">gobject.SIGNAL_ACTION</code></span></p></td><td>Action signals are signals that may freely be emitted
on alive objects from user code via <a class="link" href="class-gobject.html#method-gobject--emit" title="gobject.GObject.emit"><code class="methodname">gobject.emit()</code>()</a> 
and friends, without the need of being embedded into extra code that
performs pre or post emission adjustments on the object. They can also be
thought of as generically callable object methods.</td></tr><tr><td><p><span class="term"><code class="literal">gobject.SIGNAL_NO_HOOKS</code></span></p></td><td> No emissions hooks are supported for this
signal.</td></tr></tbody></table><p><em class="parameter"><code>return_type</code></em> is the type of the return
value from a signal handler and may be a gobject type, type ID or instance.
The <em class="parameter"><code>param_types</code></em> parameter is a list of additional
types that are passed to the signal handler. Each parameter type may be
specified as a gobject type, type ID or instance. For example, to add a
signal to the gtk.Window type called "my-signal" that calls a handler with a
gtk.Button widget and an integer value and a return value  that is a
boolean, use:</p><pre class="programlisting">
  gobject.signal_new("my_signal", gtk.Window, gobject.SIGNAL_RUN_LAST, gobject.TYPE_BOOLEAN, (gtk.Button, gobject.TYPE_INT))
</pre></div><div class="refsect2" lang="en"><a name="function-gobject--signal-list-names"></a><h3>gobject.signal_list_names</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.signal_list_names</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</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>type</code></strong> :</span></p></td><td>a GObject type, type ID or
instance</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a list of the signal names supported by
<em class="parameter"><code>type</code></em></td></tr></tbody></table><p>The <code class="function">gobject.signal_list_names</code>() function
returns a list of the names of the signals that are supported by the
specified GObject <em class="parameter"><code>type</code></em></p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The type keyword is available in PyGTK 2.6 and above.</p></div></div><div class="refsect2" lang="en"><a name="function-gobject--signal-list-ids"></a><h3>gobject.signal_list_ids</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.signal_list_ids</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</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>type</code></strong> :</span></p></td><td>a GObject type, type ID or
instance</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a list of the signal ids supported by
<em class="parameter"><code>type</code></em></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.6 and above.</p></div><p>The <code class="function">gobject.signal_list_ids</code>() function
returns a list of the integer ids of the signals that are supported by the
GObject specified by <em class="parameter"><code>type</code></em></p></div><div class="refsect2" lang="en"><a name="function-gobject--signal-lookup"></a><h3>gobject.signal_lookup</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.signal_lookup</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</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>name</code></strong> :</span></p></td><td>the name of a signal for
<em class="parameter"><code>type</code></em></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>type</code></strong> :</span></p></td><td>a GObject type, type ID or
instance</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the integer id of a signal supported by
<em class="parameter"><code>type</code></em> or 0.</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.6 and above.</p></div><p>The <code class="function">gobject.signal_lookup</code>() function
returns the id of the signal with the name specified by
<em class="parameter"><code>name</code></em> that is supported by the GObject specified
specified by<em class="parameter"><code>type</code></em>. 0 is returned if the signal is not
found.</p></div><div class="refsect2" lang="en"><a name="function-gobject--signal-name"></a><h3>gobject.signal_name</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.signal_name</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>signal_id</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>signal_id</code></strong> :</span></p></td><td>an integer signal id</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the name of the signal or
<code class="literal">None</code>.</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.6 and above.</p></div><p>The <code class="function">gobject.signal_name</code>() function returns
the name of the signal that has the signal id specified by
<em class="parameter"><code>id</code></em>.</p></div><div class="refsect2" lang="en"><a name="function-gobject--signal-query1"></a><h3>gobject.signal_query</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.signal_query</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</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>name</code></strong> :</span></p></td><td>the name of a signal for
<em class="parameter"><code>type</code></em></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>type</code></strong> :</span></p></td><td>a GObject type, type ID or
instance</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 6-tuple containing signal information or
<code class="literal">None</code></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.6 and above.</p></div><p>The <code class="function">gobject.signal_query</code>() function returns
a 6-tuple containing information about the signal with the name specified by
<em class="parameter"><code>name</code></em> that is supported by the GObject specified by
<em class="parameter"><code>type</code></em>. If the signal is not found
<code class="literal">None</code> is returned.</p><p>The signal information 6-tuple contains:</p><div class="itemizedlist"><ul type="disc"><li>the integer signal id</li><li>the signal name</li><li>the GType that the signal is registered for</li><li>the signal flags (see the <a class="xref" href="gobject-constants.html#gobject-signal-constants" title="GObject Signal Flag Constants">GObject Signal Flag Constants</a>)</li><li>the GType of the return from the signal callback
function</li><li>a tuple containing the GTypes of the parameters that are
passed to the signal callback function. Note that these may not correspond
exactly to the <code class="literal">PyGTK</code> signal callback parameters.</li></ul></div></div><div class="refsect2" lang="en"><a name="function-gobject--signal-query2"></a><h3>gobject.signal_query</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.signal_query</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>signal_id</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>signal_id</code></strong> :</span></p></td><td>the integer id of a signal</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 6-tuple containing signal information or
<code class="literal">None</code></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.6 and above.</p></div><p>The <code class="function">gobject.signal_query</code>() function returns
a 6-tuple containing information about the signal with the id specified by
<em class="parameter"><code>signal_id</code></em>. If the signal is not found
<code class="literal">None</code> is returned.</p><p>The signal information 6-tuple contains:</p><div class="itemizedlist"><ul type="disc"><li>the integer signal id</li><li>the signal name</li><li>the GType that the signal is registered for</li><li>the signal flags (see the <a class="xref" href="gobject-constants.html#gobject-signal-constants" title="GObject Signal Flag Constants">GObject Signal Flag Constants</a>)</li><li>the GType of the return from the signal callback
function</li><li>a tuple containing the GTypes of the parameters that are
passed to the signal callback function. Note that these may not correspond
exactly to the <code class="literal">PyGTK</code> signal callback parameters.</li></ul></div></div><div class="refsect2" lang="en"><a name="function-gobject--list-properties"></a><h3>gobject.list_properties</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.list_properties</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></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>type</code></em> :</span></p></td><td>a GObject type, type ID or
instance</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a list of the properties (as GParam objects)
supported by <em class="parameter"><code>type</code></em></td></tr></tbody></table><p>The <code class="function">gobject.list_properties</code>() function
returns a list of the properties (as GParam objects) supported by
<em class="parameter"><code>type</code></em>.</p></div><div class="refsect2" lang="en"><a name="function-gobject--new"></a><h3>gobject.new</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.new</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></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>type</code></em> :</span></p></td><td>a GObject type, type ID or
instance</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>zero or more property-value
pairs</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new object if the specified
<em class="parameter"><code>type</code></em></td></tr></tbody></table><p>The <code class="function">gobject.new</code>() function returns a new
object of the specified <em class="parameter"><code>type</code></em>. type must specify a
type that is a descendant of <a class="link" href="class-gobject.html" title="gobject.GObject"><code class="classname">gobject.GObject</code></a>. A
TypeError exception is raised if <em class="parameter"><code>type</code></em> specifies an
abstract class or a type that is not a descendant of <a class="link" href="class-gobject.html" title="gobject.GObject"><code class="classname">gobject.GObject</code></a>. A set
of property-value pairs may be specified to set the value of the object's
properties.</p></div><div class="refsect2" lang="en"><a name="function-gobject--idle-add"></a><h3>gobject.idle_add</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.idle_add</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>callback</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></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>callback</code></em> :</span></p></td><td>a function to call when
<code class="literal">PyGTK</code> is idle</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>optionals arguments to be passed to
<em class="parameter"><code>callback</code></em></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>an integer ID</td></tr></tbody></table><p>The <code class="function">gobject.idle_add</code>() function adds a
function (specified by <em class="parameter"><code>callback</code></em>) to be called
whenever there are no higher priority events pending to the default main
loop. The function is given the default idle priority,
<code class="literal">gobject.PRIORITY_DEFAULT_IDLE</code>. Additional arguments to
pass to <em class="parameter"><code>callback</code></em> can be specified after
<em class="parameter"><code>callback</code></em>. The idle priority can be specified as a
keyword-value pair with the keyword "priority". If
<em class="parameter"><code>callback</code></em> returns <code class="literal">FALSE</code> it is
automatically removed from the list of event sources and will not be called
again.</p></div><div class="refsect2" lang="en"><a name="function-gobject--timeout-add"></a><h3>gobject.timeout_add</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.timeout_add</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>interval</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>callback</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></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>interval</code></em> :</span></p></td><td>the time between calls to the function, in
milliseconds </td></tr><tr><td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td><td>the function to call</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>zero or more arguments that will be passed to
<em class="parameter"><code>callback</code></em></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>an integer ID of the event
source</td></tr></tbody></table><p>The <code class="function">gobject.timeout_add</code>() function sets a
function (specified by <em class="parameter"><code>callback</code></em>) to be called at
regular intervals (specified by <em class="parameter"><code>interval</code></em>, with the
default priority, <code class="literal">gobject.PRIORITY_DEFAULT</code>. Additional
arguments to pass to <em class="parameter"><code>callback</code></em> can be specified after
<em class="parameter"><code>callback</code></em>. The idle priority may be specified as a
keyword-value pair with the keyword "priority".</p><p>The function is called repeatedly until it returns
<code class="literal">FALSE</code>, at which point the timeout is automatically
destroyed and the function will not be called again. The first call to the
function will be at the end of the first interval. Note that timeout
functions may be delayed, due to the processing of other event sources. Thus
they should not be relied on for precise timing. After each call to the
timeout function, the time of the next timeout is recalculated based on the
current time and the given interval (it does not try to 'catch up' time lost
in delays).</p></div><div class="refsect2" lang="en"><a name="function-gobject--io-add-watch"></a><h3>gobject.io_add_watch</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.io_add_watch</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>fd</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>condition</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>callback</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></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>fd</code></em> :</span></p></td><td>a Python file object or an integer file
descriptor ID</td></tr><tr><td><p><span class="term"><em class="parameter"><code>condition</code></em> :</span></p></td><td>a condition mask</td></tr><tr><td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td><td>a function to call</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional arguments to pass to
<em class="parameter"><code>callback</code></em></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>an integer ID of the event source</td></tr></tbody></table><p>The <code class="function">gobject.io_add_watch</code>() function
arranges for the file (specified by <em class="parameter"><code>fd</code></em>) to be
monitored by the main loop for the specified
<em class="parameter"><code>condition</code></em>. <em class="parameter"><code>fd</code></em> may be a Python
file object or an integer file descriptor. The value of condition is a
combination 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">gobject.IO_IN</code></span></p></td><td>There is data to read.</td></tr><tr><td><p><span class="term"><code class="literal">gobject.IO_OUT</code></span></p></td><td>Data can be written (without blocking). </td></tr><tr><td><p><span class="term"><code class="literal">gobject.IO_PRI</code></span></p></td><td>There is urgent data to read.</td></tr><tr><td><p><span class="term"><code class="literal">gobject.IO_ERR</code></span></p></td><td>Error condition.</td></tr><tr><td><p><span class="term"><code class="literal">gobject.IO_HUP</code></span></p></td><td>Hung up (the connection has been broken, usually for
pipes and sockets).</td></tr></tbody></table><p>Additional arguments to pass to <em class="parameter"><code>callback</code></em>
can be specified after <em class="parameter"><code>callback</code></em>. The idle priority
may be specified as a keyword-value pair with the keyword "priority". The
signature of the callback function is:</p><pre class="programlisting">
  def callback(source, cb_condition, ...)
</pre><p>where <em class="parameter"><code>source</code></em> is
<em class="parameter"><code>fd</code></em>, the file descriptor;
<em class="parameter"><code>cb_condition</code></em> is the condition that triggered the
signal; and, <em class="parameter"><code>...</code></em> are the zero or more arguments that
were passed to the <code class="function">gobject.io_add_watch</code>()
function.</p><p>If the callback function returns <code class="literal">FALSE</code> it
will be automatically removed from the list of event sources and will not be
called again. If it returns <code class="literal">TRUE</code> it will be called again
when the condition is matched.</p></div><div class="refsect2" lang="en"><a name="function-gobject--source-remove"></a><h3>gobject.source_remove</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.source_remove</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>tag</code></em></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>tag</code></em> :</span></p></td><td>an integer ID</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">TRUE</code> if the event source was
removed</td></tr></tbody></table><p>The <code class="function">gobject.source_remove</code>() function
removes the event source specified by tag (as returned by the <a class="link" href="gobject-functions.html#function-gobject--idle-add" title="gobject.idle_add"><code class="function">gobject.idle_add</code>()</a>, 
<a class="link" href="gobject-functions.html#function-gobject--timeout-add" title="gobject.timeout_add"><code class="function">gobject.timeout_add</code></a>() 
and <a class="link" href="gobject-functions.html#function-gobject--io-add-watch" title="gobject.io_add_watch"><code class="function">gobject.io_add_watch</code>()</a> 
functions)</p></div><div class="refsect2" lang="en"><a name="function-gobject--main-context-default"></a><h3>gobject.main_context_default</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.main_context_default</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 default gobject.MainContext
object</td></tr></tbody></table><p>The <code class="function">gobject.main_context_default</code>() function
returns the default gobject.MainContext object.</p></div><div class="refsect2" lang="en"><a name="function-gobject--markup-escape-text"></a><h3>gobject.markup_escape_text</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.markup_escape_text</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>text</code></em></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>text</code></em> :</span></p></td><td>the UTF-8 string to be
escaped</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the escaped text</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.8 and above.</p></div><p>The <code class="function">gobject.markup_escape_text</code>() function
escapes the string specified by <em class="parameter"><code>text</code></em> so that the
markup parser will parse it verbatim. Less than, greater than, ampersand,
etc. are replaced with the corresponding entities. This function would
typically be used when writing out a file to be parsed with the markup
parser.</p><p>Note that this function doesn't protect whitespace and line
endings from being processed according to the XML rules for normalization of
line endings and attribute values.</p></div><div class="refsect2" lang="en"><a name="function-gobject--child-watch-add"></a><h3>gobject.child_watch_add</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.child_watch_add</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>pid</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>data</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>priority</code></strong></span><span class="initializer">=gobject.PRIORITY_DEFAULT</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>pid</code></strong> :</span></p></td><td>process id of a child process to watch</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>function</code></strong> :</span></p></td><td>the function to call</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>data</code></strong> :</span></p></td><td>the optional data to pass to
<em class="parameter"><code>function</code></em></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>priority</code></strong> :</span></p></td><td>the priority of the idle source - one of the
<a class="xref" href="gobject-constants.html#gobject-priority-constants" title="GObject Priority Constants">GObject Priority Constants</a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the id of event source.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.6 and above.</p></div><p>The <code class="function">gobject.child_watch_add</code>() function sets
the function specified by <em class="parameter"><code>function</code></em> to be called with
the user data specified by <em class="parameter"><code>data</code></em> when the child
indicated by <em class="parameter"><code>pid</code></em> exits. The signature for the
callback is:</p><pre class="programlisting">
def callback(pid, condition, user_data)
</pre><p>where <em class="parameter"><code>pid</code></em> is is the child process id,
<em class="parameter"><code>condition</code></em> is the status information about the child
process and <em class="parameter"><code>user_data</code></em> is <em class="parameter"><code>data</code></em>
PyGTK supports only a single callback per process id.</p></div><div class="refsect2" lang="en"><a name="function-gobject--spawn-async"></a><h3>gobject.spawn_async</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.spawn_async</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>argv</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>envp</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>working_directory</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>flags</code></strong></span><span class="initializer">=0</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>child_setup</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>user_data</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>standard_input</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>standard_output</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>standard_error</code></strong></span><span class="initializer">=None</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>argv</code></strong> :</span></p></td><td>a sequence of strings containing the arguments
of the child process</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>envp</code></strong> :</span></p></td><td>the child's environment or
<code class="literal">None</code> to inherit the parent's
environment.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>working_directory</code></strong> :</span></p></td><td>the child's current working directory, or
<code class="literal">None</code> to inherit parent's</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>flags</code></strong> :</span></p></td><td>flags from the <a class="xref" href="gobject-constants.html#gobject-spawn-flag-constants" title="GObject Spawn Flag Constants">GObject Spawn Flag Constants</a>.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>child_setup</code></strong> :</span></p></td><td>a function to run in the child just before
calling <code class="function">exec</code>()</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>user_data</code></strong> :</span></p></td><td>the user data for the
<em class="parameter"><code>child_setup</code></em> function</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>standard_input</code></strong> :</span></p></td><td>if <code class="literal">TRUE</code> return the file
descriptor for the child's stdin</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>standard_output</code></strong> :</span></p></td><td>if <code class="literal">TRUE</code> return the file
descriptor for the child's stdout</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>standard_error</code></strong> :</span></p></td><td>if <code class="literal">TRUE</code> return the file
descriptor for the child's stderr</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 4-tuple containing the child's process id and
the stdin, stdout and stderr file descriptor integers.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.6 and above.</p></div><p>The <code class="function">gobject.spawn_async</code>() function executes
a child program asynchronously (your program will not block waiting for the
child to exit). The child program is specified by the only argument that
must be provided, <em class="parameter"><code>argv</code></em>. <em class="parameter"><code>argv</code></em>
should be a sequence of strings, to be passed as the argument vector for the
child. The first string in <em class="parameter"><code>argv</code></em> is of course the name
of the program to execute. By default, the name of the program must be a
full path; the <code class="envar">PATH</code> shell variable will only be searched if
you pass the <code class="literal">gobject.SPAWN_SEARCH_PATH</code> flag in
<em class="parameter"><code>flags</code></em>. The function returns a 4-tuple containing the
child's process id and the file descriptors for the child's stdin, stdout
and stderr. The stdin, stdout and stderr file descriptors are returned only
ofthe corresponding <em class="parameter"><code>standard_input</code></em>,
<em class="parameter"><code>standard_output</code></em> or
<em class="parameter"><code>standard_error</code></em> params are
<code class="literal">TRUE</code>.</p><p>On Windows, the low-level child process creation API
(<code class="function">CreateProcess</code>()) doesn't use argument vectors, but a
command line. The C runtime library's <code class="function">spawn*</code>() family
of functions (which <a class="link" href="gobject-functions.html#function-gobject--spawn-async" title="gobject.spawn_async"><code class="function">gobject.spawn_async</code>()</a>
eventually calls) paste the argument vector elements into a command line,
and the C runtime startup code does a corresponding reconstruction of an
argument vector from the command line, to be passed to
<code class="function">main</code>(). Complications arise when you have argument
vector elements that contain spaces of double quotes. The
<code class="function">spawn*</code>() functions don't do any quoting or escaping,
but on the other hand the startup code does do unquoting and unescaping in
order to enable receiving arguments with embedded spaces or double
quotes. To work around this asymmetry, the <a class="link" href="gobject-functions.html#function-gobject--spawn-async" title="gobject.spawn_async"><code class="function">gobject.spawn_async</code>()</a>
function will do quoting and escaping on argument vector elements that need
it before calling the C runtime <code class="function">spawn</code>()
function.</p><p><em class="parameter"><code>envp</code></em> is a sequence of strings, where each
 string has the form <code class="literal">KEY=VALUE</code>. This will become the
 child's environment. If <em class="parameter"><code>envp</code></em> is
 <em class="parameter"><code>None</code></em> or not specified, the child inherits its
 parent's environment.</p><p><em class="parameter"><code>flags</code></em> should be the bitwise
<code class="literal">OR</code> of the <a class="xref" href="gobject-constants.html#gobject-spawn-flag-constants" title="GObject Spawn Flag Constants">GObject Spawn Flag Constants</a> you want to affect the
function's behaviour. The <code class="literal">gobject.SPAWN_DO_NOT_REAP_CHILD</code>
flag means that the child will not automatically be reaped; you must use a
GChildWatch source to be notified about the death of the child
process. Eventually you must call g_spawn_close_pid() on the child_pid, in
order to free resources which may be associated with the child process. (On
Unix, using a GChildWatch source is equivalent to calling
<code class="function">waitpid</code>() or handling the <code class="literal">SIGCHLD</code>
signal manually. On Windows, calling g_spawn_close_pid() is equivalent to
calling <code class="function">CloseHandle</code>() on the process handle
returned).</p><p><code class="literal">gobject.SPAWN_LEAVE_DESCRIPTORS_OPEN</code> means
that the parent's open file descriptors will be inherited by the child;
otherwise all descriptors except stdin/stdout/stderr will be closed before
calling <code class="function">exec</code>() in the
child. <code class="literal">gobject.SPAWN_SEARCH_PATH</code> means that
<em class="parameter"><code>argv</code></em>[0] need not be an absolute path, it will be
looked for in the user's
<code class="envar">PATH</code>. <code class="literal">gobject.SPAWN_STDOUT_TO_DEV_NULL</code>
means that the child's standard output will be discarded, instead of going
to the same location as the parent's standard output. If you use this flag,
<em class="parameter"><code>standard_output</code></em> must be
<code class="literal">None</code>. <code class="literal">gobject.SPAWN_STDERR_TO_DEV_NULL</code>
means that the child's standard error will be discarded, instead of going to
the same location as the parent's standard error. If you use this flag,
<em class="parameter"><code>standard_error</code></em> must be
<code class="literal">None</code>. <code class="literal">gobject.SPAWN_CHILD_INHERITS_STDIN</code>
means that the child will inherit the parent's standard input (by default,
the child's standard input is attached to
<code class="filename">/dev/null</code>). If you use this flag,
<em class="parameter"><code>standard_input</code></em> must be
<code class="literal">None</code>. <code class="literal">gobject.SPAWN_FILE_AND_ARGV_ZERO</code>
means that the first element of <em class="parameter"><code>argv</code></em> is the file to
execute, while the remaining elements are the actual argument vector to pass
to the file. Normally the <a class="link" href="gobject-functions.html#function-gobject--spawn-async" title="gobject.spawn_async"><code class="function">gobject.spawn_async</code>()</a>
function uses <em class="parameter"><code>argv</code></em>[0] as the file to execute, and
passes all of <em class="parameter"><code>argv</code></em> to the child.</p><p><em class="parameter"><code>child_setup</code></em> and
<em class="parameter"><code>user_data</code></em> are a function and user data. On POSIX
platforms, the function is called in the child after GLib has performed all
the setup it plans to perform (including creating pipes, closing file
descriptors, etc.) but before calling <code class="function">exec</code>(). That is,
<em class="parameter"><code>child_setup</code></em> is called just before calling
<code class="function">exec</code>() in the child. Obviously actions taken in this
function will only affect the child, not the parent. On Windows, there is no
separate <code class="function">fork</code>() and <code class="function">exec</code>()
functionality. Child processes are created and run right away with one API
call,
<code class="function">CreateProcess</code>(). <em class="parameter"><code>child_setup</code></em> is
called in the parent process just before creating the child process. You
should carefully consider what you do in <em class="parameter"><code>child_setup</code></em>
if you intend your software to be portable to Windows.</p><p>The returned child process id can be used to send signals to the
child, or to wait for the child if you specified the
<code class="literal">gobject.SPAWN_DO_NOT_REAP_CHILD</code> flag.  On Windows, child
pid will be returned only if you specified the
<code class="literal">gobject.SPAWN_DO_NOT_REAP_CHILD</code> flag.</p><p>The caller of the <a class="link" href="gobject-functions.html#function-gobject--spawn-async" title="gobject.spawn_async"><code class="function">gobject.spawn_async</code>()</a>
must close any returned file descriptors when they are no longer in
use.</p><p>If <em class="parameter"><code>standard_input</code></em> is
<code class="literal">None</code>, the child's standard input is attached to
<code class="filename">/dev/null</code> unless
<code class="literal">gobject.SPAWN_CHILD_INHERITS_STDIN</code> is set.</p><p>If <em class="parameter"><code>standard_error</code></em> is
<code class="literal">None</code>, the child's standard error goes to the same
location as the parent's standard error unless
<code class="literal">gobject.SPAWN_STDERR_TO_DEV_NULL</code> is set.</p><p>If <em class="parameter"><code>standard_output</code></em> is
<code class="literal">None</code>, the child's standard output goes to the same
location as the parent's standard output unless
<code class="literal">gobject.SPAWN_STDOUT_TO_DEV_NULL</code> is set.</p><p>If an error occurs, the gobject.GError exception will be
raised.</p></div><div class="refsect2" lang="en"><a name="function-gobject--get-current-time"></a><h3>gobject.get_current_time</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.get_current_time</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 current time as the number of seconds and
microseconds from the epoch.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.8 and above.</p></div><p>The <code class="function">gobject.get_current_time</code>() function
reurns the current time of day as the number of seconds and microseconds
from the epoch.</p></div><div class="refsect2" lang="en"><a name="function-gobject--main-depth"></a><h3>gobject.main_depth</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.main_depth</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 depth of the stack of calls to the main
context.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.8 and above.</p></div><p>The <code class="function">main_depth</code>() function returns the depth
of the stack of calls in the main context. That is, when called from the
toplevel, it gives 0. When called from within a callback from the <a class="link" href="class-gobjectmaincontext.html#method-gobjectmaincontext--iteration" title="gobject.MainContext.iteration"><code class="methodname">gobject.MainContext.iteration</code>()</a>
method (or the <a class="link" href="class-gobjectmainloop.html#method-gobjectmainloop--run" title="gobject.MainLoop.run"><code class="methodname">gobject.MainLoop.run</code>()</a>
method, etc.) it returns 1. When called from within a callback to a
recursive call to the <a class="link" href="class-gobjectmaincontext.html#method-gobjectmaincontext--iteration" title="gobject.MainContext.iteration"><code class="methodname">gobject.MainContext.iteration</code>()</a>
method), it returns 2. And so forth.</p></div><div class="refsect2" lang="en"><a name="function-gobject--threads-init"></a><h3>gobject.threads_init</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.threads_init</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code></code></em></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"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.4 and above.</p></div><p>The <code class="function">threads_init</code>() function initializes the
      the use of Python threading in the gobject module. This function is
      different than the <PYGTKDOCLINK HREF="function-gdk--threads-init"><code class="function">gtk.gdk.threads_init</code>()</PYGTKDOCLINK>
      function as that function also initializes the gdk threads.</p></div><div class="refsect2" lang="en"><a name="function-gobject--signal-accumulator-true-handled"></a><h3>gobject.signal_accumulator_true_handled</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.signal_accumulator_true_handled</span>()</code></pre><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.8 and above.</p></div><p>The <code class="function">signal_accumulator_true_handled</code>()
      function is only used as accumulator argument when registering
      signals.</p></div><div class="refsect2" lang="en"><a name="function-gobject--add-emission-hook"></a><h3>gobject.add_emission_hook</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.add_emission_hook</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>name</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>callback</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></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"><span class="emphasis"><em>type</em></span> :</span></p></td><td>a Python GObject instance or
          type</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>name</em></span> :</span></p></td><td>a signal name</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>callback</em></span> :</span></p></td><td>a function</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>...</em></span> :</span></p></td><td>zero or more extra arguments that will be
          passed to callback.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the hook id, for later use with <PYGTKDOCLINK HREF="function-gobject--signal-remove-emission-hook"><code class="function">gobject.signal_remove_emission_hook</code>()</PYGTKDOCLINK>.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.8 and above.</p></div><p>The <code class="function">add_emission_hook</code>() function adds an
      emission hook for the signal specified by <em class="parameter"><code>name</code></em>,
      which will get called for any emission of that signal, independent of
      the instance. This is possible only for signals which don't have the
      <code class="literal">gobject.SIGNAL_NO_HOOKS</code> flag set.</p></div><div class="refsect2" lang="en"><a name="function-gobject--remove-emission-hook"></a><h3>gobject.remove_emission_hook</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.remove_emission_hook</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>name</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>hook_id</code></em></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"><span class="emphasis"><em>type</em></span> :</span></p></td><td>a Python GObject instance or
          type</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>name</em></span> :</span></p></td><td>a signal name</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>hook_id</em></span> :</span></p></td><td>the id of the emission hook as returned by the
          <a class="link" href="gobject-functions.html#function-gobject--add-emission-hook" title="gobject.add_emission_hook"><code class="function">gobject.add_emission_hook</code>()</a>)
          function.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.8 and above.</p></div><p>The <code class="function">remove_emission_hook</code>() function deletes
      an emission hook.</p></div><div class="refsect2" lang="en"><a name="function-gobject---install-metaclass"></a><h3>gobject._install_metaclass</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject._install_metaclass</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>metaclass</code></em></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"><span class="emphasis"><em>metaclass</em></span> :</span></p></td><td></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.10 and above.</p></div><p>The <code class="function">_install_metaclass</code>() function installs
      the metaclass specified by <em class="parameter"><code>metaclass</code></em>.</p></div><div class="refsect2" lang="en"><a name="function-gobject--filename-display-name"></a><h3>gobject.filename_display_name</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.filename_display_name</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>filename</code></em></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"><span class="emphasis"><em>filename</em></span> :</span></p></td><td>a pathname in the file name
          encoding</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>an UTF8 rendition of
          <em class="parameter"><code>filename</code></em>.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.10 and above.</p></div><p>The <code class="function">filename_display_name</code>() function
      converts a filename into a valid UTF-8 string. The conversion is not
      necessarily reversible, so you should keep the original around and use
      the return value of this function only for display purposes. Unlike
      g_filename_to_utf8(), the result is guaranteed to be non-None even if
      the filename actually isn't in the file name encoding.</p><p>If you know the whole pathname of the file you should use the
      <a class="link" href="gobject-functions.html#function-gobject--filename-display-basename" title="gobject.filename_display_basename"><code class="function">gobject.filename_display_basename</code>()</a>
      function, since that allows location-based translation of
      filenames.</p></div><div class="refsect2" lang="en"><a name="function-gobject--filename-display-basename"></a><h3>gobject.filename_display_basename</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.filename_display_basename</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>filename</code></em></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"><span class="emphasis"><em>filename</em></span> :</span></p></td><td>an absolute pathname in the file name
          encoding</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>an UTF8 rendition of
          <em class="parameter"><code>filename</code></em>.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.10 and above.</p></div><p>The <code class="function">filename_display_basename</code>() function
      returns the display basename for the particular filename, guaranteed
      to be valid UTF-8. The display name might not be identical to the
      filename, for instance there might be problems converting it to UTF-8,
      and some files can be translated in the display.</p><p>You must pass the whole absolute pathname to this functions so
      that translation of well known locations can be done.</p><p>This function is preferred over the <a class="link" href="gobject-functions.html#function-gobject--filename-display-name" title="gobject.filename_display_name"><code class="function">gobject.filename_display_name</code>()</a>
      function if you know the whole path, as it allows translation.</p></div><div class="refsect2" lang="en"><a name="function-gobject--filename-from-utf8"></a><h3>gobject.filename_from_utf8</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.filename_from_utf8</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>utf8string</code></em></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"><span class="emphasis"><em>utf8string</em></span> :</span></p></td><td>a UTF-8 encoded string.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a filename encoded in the GLib filename
          encoding.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.10 and above.</p></div><p>The <code class="function">filename_from_utf8</code>() function converts
      a string from UTF-8 to the encoding GLib uses for filenames. Note that
      on Windows GLib uses UTF-8 for filenames.</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-gobjectmainloop.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gobject-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="gobject-constants.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gobject.MainLoop </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gobject Constants</td></tr></table></div></body></html>