File: gobject-functions.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 (172 lines) | stat: -rw-r--r-- 45,024 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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gobject Functions</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="gobject-class-reference.html" title="The gobject Class Reference"><link rel="previous" 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><div></div></div><div class="refnamediv"><h2>gobject Functions</h2><p>gobject Functions &#8212; miscellaneous functions</p></div><div class="refsect1" lang="en"><a name="id2992012"></a><h2>Synopsis</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
<code class="methodsynopsis">    def <span class="methodname"><a href="gobject-functions.html#function-gobject--type-name" title="gobject.type_name">gobject.type_name</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>type</tt></i></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><i class="parameter"><tt>type_name</tt></i></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="gobject-functions.html#function-gobject--type-parent" title="gobject.type_parent">gobject.type_parent</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>type</tt></i></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><i class="parameter"><tt>type</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>parent_type</tt></i></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="gobject-functions.html#function-gobject--type-children" title="gobject.type_children">gobject.type_children</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>type</tt></i></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="gobject-functions.html#function-gobject--type-interfaces" title="gobject.type_interfaces">gobject.type_interfaces</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>type</tt></i></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="gobject-functions.html#function-gobject--type-register" title="gobject.type_register">gobject.type_register</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>class</tt></i></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="gobject-functions.html#function-gobject--signal-new" title="gobject.signal_new">gobject.signal_new</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>signal_name</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>type</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>flags</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>return_type</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>param_types</tt></i></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>type</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>type</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="gobject-functions.html#function-gobject--signal-lookup" title="gobject.signal_lookup">gobject.signal_lookup</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>name</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="gobject-functions.html#function-gobject--signal-name" title="gobject.signal_name">gobject.signal_name</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>signal_id</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="gobject-functions.html#function-gobject--signal-query1" title="gobject.signal_query">gobject.signal_query</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>name</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="gobject-functions.html#function-gobject--signal-query2" title="gobject.signal_query">gobject.signal_query</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>signal_id</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="gobject-functions.html#function-gobject--list-properties" title="gobject.list_properties">gobject.list_properties</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>type</tt></i></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="gobject-functions.html#function-gobject--new" title="gobject.new">gobject.new</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>type</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="gobject-functions.html#function-gobject--idle-add" title="gobject.idle_add">gobject.idle_add</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>callback</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="gobject-functions.html#function-gobject--timeout-add" title="gobject.timeout_add">gobject.timeout_add</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>interval</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>callback</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><i class="parameter"><tt>fd</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>condition</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>callback</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="gobject-functions.html#function-gobject--source-remove" title="gobject.source_remove">gobject.source_remove</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>tag</tt></i></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3004222"></a><h2>Description</h2><p>These functions are part of the <tt class="literal">PyGTK</tt> gobject
module but are not directly associated with a specific class.</p></div><div class="refsect1" lang="en"><a name="id3012950"></a><h2>Functions</h2><div class="refsect2" lang="en"><a name="function-gobject--type-name"></a><h3>gobject.type_name</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.type_name</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>type</tt></i></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>type</tt></i>:</span></td><td>a GObject type, type ID or
instance</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td></td></tr></tbody></table><p>The <tt class="function">gobject.type_name</tt>() function returns
the unique name that is assigned to the specified
<i class="parameter"><tt>type</tt></i>. <i class="parameter"><tt>type</tt></i> can be a GObject
type, type ID or instance. This function raises a TypeError exception
if <i class="parameter"><tt>type</tt></i> isn't a <tt class="literal">PyGTK</tt> type.</p></div><div class="refsect2" lang="en"><a name="function-gobject--type-from-name"></a><h3>gobject.type_from_name</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.type_from_name</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>type_name</tt></i></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>type_name</tt></i>:</span></td><td>a string containing the name of a
type</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the type ID named
<i class="parameter"><tt>type_name</tt></i></td></tr></tbody></table><p>The <tt class="function">gobject.type_from_name</tt>() function
returns the type ID of the <tt class="literal">PyGTK</tt> type with the name
specified by <i class="parameter"><tt>type_name</tt></i>. This function raises a
RuntimeError exception if no type matches
<i class="parameter"><tt>type_name</tt></i>.</p></div><div class="refsect2" lang="en"><a name="function-gobject--type-parent"></a><h3>gobject.type_parent</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.type_parent</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>type</tt></i></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>type</tt></i>:</span></td><td>a GObject type, type ID or
instance</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the parent type ID</td></tr></tbody></table><p>The <tt class="function">gobject.type_parent</tt>() function returns
the direct parent type ID of the specified <i class="parameter"><tt>type</tt></i>.
<i class="parameter"><tt>type</tt></i> can be a GObject type, type ID or instance. If
<i class="parameter"><tt>type</tt></i> 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><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.type_is_a</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>type</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>parent_type</tt></i></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>type</tt></i>:</span></td><td>a GObject type, type ID or
instance</td></tr><tr><td><span class="term"><i class="parameter"><tt>parent_type</tt></i>:</span></td><td>a GObject type, type ID or
instance</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td><tt class="literal">TRUE</tt> if
<i class="parameter"><tt>parent_type</tt></i> is an ancestor of
<i class="parameter"><tt>type</tt></i></td></tr></tbody></table><p>The <tt class="function">gobject.type_is_a</tt>() function returns
<tt class="literal">TRUE</tt> if the specified <i class="parameter"><tt>type</tt></i> is a
descendant of the type specified by <i class="parameter"><tt>parent_type</tt></i>. This
function also returns <tt class="literal">TRUE</tt> if
<i class="parameter"><tt>parent_type</tt></i> is an interface and
<i class="parameter"><tt>type</tt></i> conforms to it.</p></div><div class="refsect2" lang="en"><a name="function-gobject--type-children"></a><h3>gobject.type_children</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.type_children</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>type</tt></i></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>type</tt></i>:</span></td><td>a GObject type, type ID or
instance</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a list of the child types of
<i class="parameter"><tt>type</tt></i></td></tr></tbody></table><p>The <tt class="function">gobject.type_children</tt>() function
returns a list containing the child types of the specified
<i class="parameter"><tt>type</tt></i>.</p></div><div class="refsect2" lang="en"><a name="function-gobject--type-interfaces"></a><h3>gobject.type_interfaces</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.type_interfaces</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>type</tt></i></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>type</tt></i>:</span></td><td>a GObject type, type ID or
instance</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a list of the interface types supported by
<i class="parameter"><tt>type</tt></i></td></tr></tbody></table><p>The <tt class="function">gobject.type_interfaces</tt>() function
returns a list of the interface types supported by
<i class="parameter"><tt>type</tt></i>. <i class="parameter"><tt>type</tt></i> 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><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.type_register</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>class</tt></i></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>class</tt></i>:</span></td><td>a Python class that is a descendant of <a href="class-gobject.html" title="gobject.GObject"><tt class="classname">gobject.GObject</tt></a></td></tr></tbody></table><p>The <tt class="function">gobject.type_register</tt>() function
registers the specified Python <i class="parameter"><tt>class</tt></i> as a PyGTK type.
class must be a descendant of <a href="class-gobject.html" title="gobject.GObject"><tt class="classname">gobject.GObject</tt></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><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.signal_new</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>signal_name</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>type</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>flags</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>return_type</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>param_types</tt></i></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>signal_name</tt></i>:</span></td><td>a string containing the name of the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>type</tt></i>:</span></td><td>the object type that the signal is associated
with</td></tr><tr><td><span class="term"><i class="parameter"><tt>flags</tt></i>:</span></td><td>the signal flags</td></tr><tr><td><span class="term"><i class="parameter"><tt>return_type</tt></i>:</span></td><td>the return type of the signal
handler</td></tr><tr><td><span class="term"><i class="parameter"><tt>param_types</tt></i>:</span></td><td>the parameter types passed to the signal
handler</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a unique integer signal ID</td></tr></tbody></table><p>The <tt class="function">gobject.signal_new</tt>() function registers
a signal with the specified <i class="parameter"><tt>signal_name</tt></i> for the
specified object <i class="parameter"><tt>type</tt></i>. The value of
<i class="parameter"><tt>flags</tt></i> is a combination 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">gobject.SIGNAL_RUN_FIRST</tt></span></td><td>Invoke the object method handler in the first emission
stage. </td></tr><tr><td><span class="term"><tt class="literal">gobject.SIGNAL_RUN_LAST</tt></span></td><td>Invoke the object method handler in the third emission
stage.</td></tr><tr><td><span class="term"><tt class="literal">gobject.SIGNAL_RUN_CLEANUP</tt></span></td><td>Invoke the object method handler in the last emission
stage.</td></tr><tr><td><span class="term"><tt class="literal">gobject.SIGNAL_NO_RECURSE</tt></span></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><span class="term"><tt class="literal">gobject.SIGNAL_DETAILED</tt></span></td><td>This signal supports "::detail" appendixes to the
signal name upon handler connections and emissions.</td></tr><tr><td><span class="term"><tt class="literal">gobject.SIGNAL_ACTION</tt></span></td><td>Action signals are signals that may freely be emitted
on alive objects from user code via <a href="class-gobject.html#method-gobject--emit" title="gobject.GObject.emit"><tt class="methodname">gobject.emit()</tt>()</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><span class="term"><tt class="literal">gobject.SIGNAL_NO_HOOKS</tt></span></td><td> No emissions hooks are supported for this
signal.</td></tr></tbody></table><p><i class="parameter"><tt>return_type</tt></i> is the type of the return
value from a signal handler and may be a gobject type, type ID or instance.
The <i class="parameter"><tt>param_types</tt></i> 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><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  gobject.signal_new("my_signal", gtk.Window, gobject.SIGNAL_RUN_LAST, gobject.TYPE_BOOLEAN, (gtk.Button, gobject.TYPE_INT))
</pre></td></tr></table></div><div class="refsect2" lang="en"><a name="function-gobject--signal-list-names"></a><h3>gobject.signal_list_names</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.signal_list_names</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</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>type</tt></b>:</span></td><td>a GObject type, type ID or
instance</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a list of the signal names supported by
<i class="parameter"><tt>type</tt></i></td></tr></tbody></table><p>The <tt class="function">gobject.signal_list_names</tt>() function
returns a list of the names of the signals that are supported by the
specified GObject <i class="parameter"><tt>type</tt></i></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><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.signal_list_ids</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</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>type</tt></b>:</span></td><td>a GObject type, type ID or
instance</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a list of the signal ids supported by
<i class="parameter"><tt>type</tt></i></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 <tt class="function">gobject.signal_list_ids</tt>() function
returns a list of the integer ids of the signals that are supported by the
GObject specified by <i class="parameter"><tt>type</tt></i></p></div><div class="refsect2" lang="en"><a name="function-gobject--signal-lookup"></a><h3>gobject.signal_lookup</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.signal_lookup</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>name</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</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>name</tt></b>:</span></td><td>the name of a signal for
<i class="parameter"><tt>type</tt></i></td></tr><tr><td><span class="term"><b class="parameter"><tt>type</tt></b>:</span></td><td>a GObject type, type ID or
instance</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the integer id of a signal supported by
<i class="parameter"><tt>type</tt></i> 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 <tt class="function">gobject.signal_lookup</tt>() function
returns the id of the signal with the name specified by
<i class="parameter"><tt>name</tt></i> that is supported by the GObject specified
specified by<i class="parameter"><tt>type</tt></i>. 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><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.signal_name</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>signal_id</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>signal_id</tt></b>:</span></td><td>an integer signal id</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the name of the signal or
<tt class="literal">None</tt>.</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 <tt class="function">gobject.signal_name</tt>() function returns
the name of the signal that has the signal id specified by
<i class="parameter"><tt>id</tt></i>.</p></div><div class="refsect2" lang="en"><a name="function-gobject--signal-query1"></a><h3>gobject.signal_query</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.signal_query</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>name</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</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>name</tt></b>:</span></td><td>the name of a signal for
<i class="parameter"><tt>type</tt></i></td></tr><tr><td><span class="term"><b class="parameter"><tt>type</tt></b>:</span></td><td>a GObject type, type ID or
instance</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a 6-tuple containing signal information or
<tt class="literal">None</tt></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 <tt class="function">gobject.signal_query</tt>() function returns
a 6-tuple containing information about the signal with the name specified by
<i class="parameter"><tt>name</tt></i> that is supported by the GObject specified by
<i class="parameter"><tt>type</tt></i>. If the signal is not found
<tt class="literal">None</tt> 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 href="gobject-constants.html#gobject-signal-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 <tt class="literal">PyGTK</tt> signal callback parameters.</li></ul></div></div><div class="refsect2" lang="en"><a name="function-gobject--signal-query2"></a><h3>gobject.signal_query</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.signal_query</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>signal_id</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>signal_id</tt></b>:</span></td><td>the integer id of a signal</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a 6-tuple containing signal information or
<tt class="literal">None</tt></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 <tt class="function">gobject.signal_query</tt>() function returns
a 6-tuple containing information about the signal with the id specified by
<i class="parameter"><tt>signal_id</tt></i>. If the signal is not found
<tt class="literal">None</tt> 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 href="gobject-constants.html#gobject-signal-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 <tt class="literal">PyGTK</tt> signal callback parameters.</li></ul></div></div><div class="refsect2" lang="en"><a name="function-gobject--list-properties"></a><h3>gobject.list_properties</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.list_properties</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>type</tt></i></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>type</tt></i>:</span></td><td>a GObject type, type ID or
instance</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a list of the properties (as GParam objects)
supported by <i class="parameter"><tt>type</tt></i></td></tr></tbody></table><p>The <tt class="function">gobject.list_properties</tt>() function
returns a list of the properties (as GParam objects) supported by
<i class="parameter"><tt>type</tt></i>.</p></div><div class="refsect2" lang="en"><a name="function-gobject--new"></a><h3>gobject.new</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.new</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>type</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></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>type</tt></i>:</span></td><td>a GObject type, type ID or
instance</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>zero or more property-value
pairs</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new object if the specified
<i class="parameter"><tt>type</tt></i></td></tr></tbody></table><p>The <tt class="function">gobject.new</tt>() function returns a new
object of the specified <i class="parameter"><tt>type</tt></i>. type must specify a
type that is a descendant of <a href="class-gobject.html" title="gobject.GObject"><tt class="classname">gobject.GObject</tt></a>. A
TypeError exception is raised if <i class="parameter"><tt>type</tt></i> specifies an
abstract class or a type that is not a descendant of <a href="class-gobject.html" title="gobject.GObject"><tt class="classname">gobject.GObject</tt></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><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.idle_add</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>callback</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></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>callback</tt></i>:</span></td><td>a function to call when
<tt class="literal">PyGTK</tt> is idle</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>optionals arguments to be passed to
<i class="parameter"><tt>callback</tt></i></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>an integer ID</td></tr></tbody></table><p>The <tt class="function">gobject.idle_add</tt>() function adds a
function (specified by <i class="parameter"><tt>callback</tt></i>) to be called
whenever there are no higher priority events pending to the default main
loop. The function is given the default idle priority,
<tt class="literal">gobject.PRIORITY_DEFAULT_IDLE</tt>. Additional arguments to
pass to <i class="parameter"><tt>callback</tt></i> can be specified after
<i class="parameter"><tt>callback</tt></i>. The idle priority can be specified as a
keyword-value pair with the keyword "priority". If
<i class="parameter"><tt>callback</tt></i> returns <tt class="literal">FALSE</tt> 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><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.timeout_add</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>interval</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>callback</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></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>interval</tt></i>:</span></td><td>the time between calls to the function, in
milliseconds </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i>:</span></td><td>the function to call</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>zero or more arguments that will be passed to
<i class="parameter"><tt>callback</tt></i></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>an integer ID of the event
source</td></tr></tbody></table><p>The <tt class="function">gobject.timeout_add</tt>() function sets a
function (specified by <i class="parameter"><tt>callback</tt></i>) to be called at
regular intervals (specified by <i class="parameter"><tt>interval</tt></i>, with the
default priority, <tt class="literal">gobject.PRIORITY_DEFAULT</tt>. Additional
arguments to pass to <i class="parameter"><tt>callback</tt></i> can be specified after
<i class="parameter"><tt>callback</tt></i>. 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
<tt class="literal">FALSE</tt>, 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><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.io_add_watch</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>fd</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>condition</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>callback</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></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>fd</tt></i>:</span></td><td>a Python file object or an integer file
descriptor ID</td></tr><tr><td><span class="term"><i class="parameter"><tt>condition</tt></i>:</span></td><td>a condition mask</td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i>:</span></td><td>a function to call</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional arguments to pass to
<i class="parameter"><tt>callback</tt></i></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>an integer ID of the event source</td></tr></tbody></table><p>The <tt class="function">gobject.io_add_watch</tt>() function
arranges for the file (specified by <i class="parameter"><tt>fd</tt></i>) to be
monitored by the main loop for the specified
<i class="parameter"><tt>condition</tt></i>. <i class="parameter"><tt>fd</tt></i> 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><span class="term"><tt class="literal">gobject.IO_IN</tt></span></td><td>There is data to read.</td></tr><tr><td><span class="term"><tt class="literal">gobject.IO_OUT</tt></span></td><td>Data can be written (without blocking). </td></tr><tr><td><span class="term"><tt class="literal">gobject.IO_PRI</tt></span></td><td>There is urgent data to read.</td></tr><tr><td><span class="term"><tt class="literal">gobject.IO_ERR</tt></span></td><td>Error condition.</td></tr><tr><td><span class="term"><tt class="literal">gobject.IO_HUP</tt></span></td><td>Hung up (the connection has been broken, usually for
pipes and sockets).</td></tr></tbody></table><p>Additional arguments to pass to <i class="parameter"><tt>callback</tt></i>
can be specified after <i class="parameter"><tt>callback</tt></i>. The idle priority
may be specified as a keyword-value pair with the keyword "priority". The
signature of the callback function is:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  def callback(source, cb_condition, ...)
</pre></td></tr></table><p>where <i class="parameter"><tt>source</tt></i> is
<i class="parameter"><tt>fd</tt></i>, the file descriptor;
<i class="parameter"><tt>cb_condition</tt></i> is the condition that triggered the
signal; and, <i class="parameter"><tt>...</tt></i> are the zero or more arguments that
were passed to the <tt class="function">gobject.io_add_watch</tt>()
function.</p><p>If the callback function returns <tt class="literal">FALSE</tt> it
will be automatically removed from the list of event sources and will not be
called again. If it returns <tt class="literal">TRUE</tt> 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><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.source_remove</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>tag</tt></i></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>tag</tt></i>:</span></td><td>an integer ID</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td><tt class="literal">TRUE</tt> if the event source was
removed</td></tr></tbody></table><p>The <tt class="function">gobject.source_remove</tt>() function
removes the event source specified by tag (as returned by the <a href="gobject-functions.html#function-gobject--idle-add" title="gobject.idle_add"><tt class="function">gobject.idle_add</tt>()</a>, 
<a href="gobject-functions.html#function-gobject--timeout-add" title="gobject.timeout_add"><tt class="function">gobject.timeout_add</tt></a>() 
and <a href="gobject-functions.html#function-gobject--io-add-watch" title="gobject.io_add_watch"><tt class="function">gobject.io_add_watch</tt>()</a> 
functions)</p></div><div class="refsect2" lang="en"><a name="function-gobject--main-context-default"></a><h3>gobject.main_context_default</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gobject.main_context_default</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 default gobject.MainContext
object</td></tr></tbody></table><p>The <tt class="function">gobject.main_context_default</tt>() function
returns the default gobject.MainContext object.</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>