3853a06821ab7b5513a5a98411dd14dd36ba51c3
[platform/upstream/pygobject2.git] / docs / html / gobject-functions.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gobject Functions</title><link rel="stylesheet" type="text/css" href="style.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="PyGObject Reference Manual"><link rel="up" href="gobject-class-reference.html" title="PyGObject Class Reference"><link rel="prev" href="class-gobjectginterface.html" title="gobject.GInterface"><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-gobjectginterface.html">Prev</a> </td><th width="60%" align="center">PyGObject 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" title="gobject Functions"><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" title="Synopsis"><a name="id361138"></a><h2>Synopsis</h2><pre class="programlisting">
2 <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--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>
3     </pre></div><div class="refsect1" title="Description"><a name="id363851"></a><h2>Description</h2><p>These functions are part of the <code class="literal">PyGTK</code> gobject
4 module but are not directly associated with a specific class.</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
5         Many functions that previously were in this namespace got moved to <a class="link" href="glib-functions.html" title="glib Functions"><code class="literal">glib</code></a> namespace instead.  They
6         are still available in <code class="literal">gobject</code> for backward compatibility, but
7         not documented here.  If you miss documentation for some function, be sure to
8         check <a class="link" href="glib-functions.html" title="glib Functions"><code class="literal">glib</code></a> first.
9       </p></div></div><div class="refsect1" title="Functions"><a name="id427695"></a><h2>Functions</h2><div class="refsect2" title="gobject.type_name"><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
10 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
11 the unique name that is assigned to the specified
12 <em class="parameter"><code>type</code></em>. <em class="parameter"><code>type</code></em> can be a GObject
13 type, type ID or instance. This function raises a TypeError exception
14 if <em class="parameter"><code>type</code></em> isn't a <code class="literal">PyGTK</code> type.</p></div><div class="refsect2" title="gobject.type_from_name"><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
15 type</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the type ID named
16 <em class="parameter"><code>type_name</code></em></td></tr></tbody></table><p>The <code class="function">gobject.type_from_name</code>() function
17 returns the type ID of the <code class="literal">PyGTK</code> type with the name
18 specified by <em class="parameter"><code>type_name</code></em>. This function raises a
19 RuntimeError exception if no type matches
20 <em class="parameter"><code>type_name</code></em>.</p></div><div class="refsect2" title="gobject.type_parent"><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
21 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
22 the direct parent type ID of the specified <em class="parameter"><code>type</code></em>.
23 <em class="parameter"><code>type</code></em> can be a GObject type, type ID or instance. If
24 <em class="parameter"><code>type</code></em> has no parent, i.e. is a fundamental type, the
25 RuntimeError exception is raised. </p></div><div class="refsect2" title="gobject.type_is_a"><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
26 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
27 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
28 <em class="parameter"><code>parent_type</code></em> is an ancestor of
29 <em class="parameter"><code>type</code></em></td></tr></tbody></table><p>The <code class="function">gobject.type_is_a</code>() function returns
30 <code class="literal">True</code> if the specified <em class="parameter"><code>type</code></em> is a
31 descendant of the type specified by <em class="parameter"><code>parent_type</code></em>. This
32 function also returns <code class="literal">True</code> if
33 <em class="parameter"><code>parent_type</code></em> is an interface and
34 <em class="parameter"><code>type</code></em> conforms to it.</p></div><div class="refsect2" title="gobject.type_children"><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
35 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
36 <em class="parameter"><code>type</code></em></td></tr></tbody></table><p>The <code class="function">gobject.type_children</code>() function
37 returns a list containing the child types of the specified
38 <em class="parameter"><code>type</code></em>.</p></div><div class="refsect2" title="gobject.type_interfaces"><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
39 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
40 <em class="parameter"><code>type</code></em></td></tr></tbody></table><p>The <code class="function">gobject.type_interfaces</code>() function
41 returns a list of the interface types supported by
42 <em class="parameter"><code>type</code></em>. <em class="parameter"><code>type</code></em> can be a GObject
43 type, type ID or instance. This function returns a RuntimeError exception if
44 type is not a valid type or has no interfaces.</p></div><div class="refsect2" title="gobject.type_register"><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
45 registers the specified Python <em class="parameter"><code>class</code></em> as a PyGTK type.
46 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" title="gobject.signal_new"><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
47 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
48 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
49 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
50 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
51 a signal with the specified <em class="parameter"><code>signal_name</code></em> for the
52 specified object <em class="parameter"><code>type</code></em>. The value of
53 <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
54 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
55 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
56 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
57 being in emission for this very object will not be emitted recursively, but
58 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
59 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
60 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> 
61 and friends, without the need of being embedded into extra code that
62 performs pre or post emission adjustments on the object. They can also be
63 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
64 signal.</td></tr></tbody></table><p><em class="parameter"><code>return_type</code></em> is the type of the return
65 value from a signal handler and may be a gobject type, type ID or instance.
66 The <em class="parameter"><code>param_types</code></em> parameter is a list of additional
67 types that are passed to the signal handler. Each parameter type may be
68 specified as a gobject type, type ID or instance. For example, to add a
69 signal to the gtk.Window type called "my-signal" that calls a handler with a
70 gtk.Button widget and an integer value and a return value  that is a
71 boolean, use:</p><pre class="programlisting">
72   gobject.signal_new("my_signal", gtk.Window, gobject.SIGNAL_RUN_LAST, gobject.TYPE_BOOLEAN, (gtk.Button, gobject.TYPE_INT))
73 </pre></div><div class="refsect2" title="gobject.signal_list_names"><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
74 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
75 <em class="parameter"><code>type</code></em></td></tr></tbody></table><p>The <code class="function">gobject.signal_list_names</code>() function
76 returns a list of the names of the signals that are supported by the
77 specified GObject <em class="parameter"><code>type</code></em></p><div class="note" title="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" title="gobject.signal_list_ids"><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
78 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
79 <em class="parameter"><code>type</code></em></td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <code class="function">gobject.signal_list_ids</code>() function
80 returns a list of the integer ids of the signals that are supported by the
81 GObject specified by <em class="parameter"><code>type</code></em></p></div><div class="refsect2" title="gobject.signal_lookup"><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
82 <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
83 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
84 <em class="parameter"><code>type</code></em> or 0.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <code class="function">gobject.signal_lookup</code>() function
85 returns the id of the signal with the name specified by
86 <em class="parameter"><code>name</code></em> that is supported by the GObject specified
87 specified by<em class="parameter"><code>type</code></em>. 0 is returned if the signal is not
88 found.</p></div><div class="refsect2" title="gobject.signal_name"><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
89 <code class="literal">None</code>.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <code class="function">gobject.signal_name</code>() function returns
90 the name of the signal that has the signal id specified by
91 <em class="parameter"><code>id</code></em>.</p></div><div class="refsect2" title="gobject.signal_query"><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
92 <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
93 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
94 <code class="literal">None</code></td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <code class="function">gobject.signal_query</code>() function returns
95 a 6-tuple containing information about the signal with the name specified by
96 <em class="parameter"><code>name</code></em> that is supported by the GObject specified by
97 <em class="parameter"><code>type</code></em>. If the signal is not found
98 <code class="literal">None</code> is returned.</p><p>The signal information 6-tuple contains:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">the integer signal id</li><li class="listitem">the signal name</li><li class="listitem">the GType that the signal is registered for</li><li class="listitem">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 class="listitem">the GType of the return from the signal callback
99 function</li><li class="listitem">a tuple containing the GTypes of the parameters that are
100 passed to the signal callback function. Note that these may not correspond
101 exactly to the <code class="literal">PyGTK</code> signal callback parameters.</li></ul></div></div><div class="refsect2" title="gobject.signal_query"><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
102 <code class="literal">None</code></td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <code class="function">gobject.signal_query</code>() function returns
103 a 6-tuple containing information about the signal with the id specified by
104 <em class="parameter"><code>signal_id</code></em>. If the signal is not found
105 <code class="literal">None</code> is returned.</p><p>The signal information 6-tuple contains:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">the integer signal id</li><li class="listitem">the signal name</li><li class="listitem">the GType that the signal is registered for</li><li class="listitem">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 class="listitem">the GType of the return from the signal callback
106 function</li><li class="listitem">a tuple containing the GTypes of the parameters that are
107 passed to the signal callback function. Note that these may not correspond
108 exactly to the <code class="literal">PyGTK</code> signal callback parameters.</li></ul></div></div><div class="refsect2" title="gobject.list_properties"><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
109 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)
110 supported by <em class="parameter"><code>type</code></em></td></tr></tbody></table><p>The <code class="function">gobject.list_properties</code>() function
111 returns a list of the properties (as GParam objects) supported by
112 <em class="parameter"><code>type</code></em>.</p></div><div class="refsect2" title="gobject.new"><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
113 instance</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>zero or more property-value
114 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
115 <em class="parameter"><code>type</code></em></td></tr></tbody></table><p>The <code class="function">gobject.new</code>() function returns a new
116 object of the specified <em class="parameter"><code>type</code></em>. type must specify a
117 type that is a descendant of <a class="link" href="class-gobject.html" title="gobject.GObject"><code class="classname">gobject.GObject</code></a>. A
118 TypeError exception is raised if <em class="parameter"><code>type</code></em> specifies an
119 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
120 of property-value pairs may be specified to set the value of the object's
121 properties.</p></div><div class="refsect2" title="gobject.signal_accumulator_true_handled"><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" title="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>()
122       function is only used as accumulator argument when registering
123       signals.</p></div><div class="refsect2" title="gobject.add_emission_hook"><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
124           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
125           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" title="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
126       emission hook for the signal specified by <em class="parameter"><code>name</code></em>,
127       which will get called for any emission of that signal, independent of
128       the instance. This is possible only for signals which don't have the
129       <code class="literal">gobject.SIGNAL_NO_HOOKS</code> flag set.</p></div><div class="refsect2" title="gobject.remove_emission_hook"><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
130           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
131           <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>)
132           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" title="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
133       an emission hook.</p></div><div class="refsect2" title="gobject._install_metaclass"><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" title="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
134       the metaclass specified by <em class="parameter"><code>metaclass</code></em>.</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-gobjectginterface.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.GInterface </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>