1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.Buildable</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="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="prev" href="class-gtkbuilder.html" title="gtk.Builder"><link rel="next" href="class-gtkbuttonbox.html" title="gtk.ButtonBox"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.Buildable</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkbuilder.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkbuttonbox.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkbuildable"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.Buildable</h2><p>gtk.Buildable — Interface for objects that can be built by GtkBuilder.</p></div><div class="refsect1" lang="en"><a name="id3356849"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.Buildable</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-ginterface">gobject.GInterface</PYGTKDOCLINK></span></span>):
2
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbuildable.html#method-gtkbuildable--add-child" title="gtk.Buildable.add_child">add_child</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>builder</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>child</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="class-gtkbuildable.html#method-gtkbuildable--construct-child" title="gtk.Buildable.construct_child">construct_child</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>builder</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbuildable.html#method-gtkbuildable--get-internal-child" title="gtk.Buildable.get_internal_child">get_internal_child</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>builder</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>childname</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbuildable.html#method-gtkbuildable--get-name" title="gtk.Buildable.get_name">get_name</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbuildable.html#method-gtkbuildable--parser-finished" title="gtk.Buildable.parser_finished">parser_finished</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>builder</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbuildable.html#method-gtkbuildable--set-name" title="gtk.Buildable.set_name">set_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3357085"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-ginterface">gobject.GInterface</PYGTKDOCLINK>
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.Buildable</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="prev" href="class-gtkbuilder.html" title="gtk.Builder"><link rel="next" href="class-gtkbuttonbox.html" title="gtk.ButtonBox"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.Buildable</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkbuilder.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkbuttonbox.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.Buildable"><a name="class-gtkbuildable"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.Buildable</h2><p>gtk.Buildable — Interface for objects that can be built by GtkBuilder.</p></div><div class="refsect1" title="Synopsis"><a name="id3625767"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.Buildable</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-ginterface">gobject.GInterface</PYGTKDOCLINK></span></span>):
2
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbuildable.html#method-gtkbuildable--add-child" title="gtk.Buildable.add_child">add_child</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>builder</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>child</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="class-gtkbuildable.html#method-gtkbuildable--construct-child" title="gtk.Buildable.construct_child">construct_child</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>builder</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbuildable.html#method-gtkbuildable--get-internal-child" title="gtk.Buildable.get_internal_child">get_internal_child</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>builder</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>childname</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbuildable.html#method-gtkbuildable--get-name" title="gtk.Buildable.get_name">get_name</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbuildable.html#method-gtkbuildable--parser-finished" title="gtk.Buildable.parser_finished">parser_finished</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>builder</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbuildable.html#method-gtkbuildable--set-name" title="gtk.Buildable.set_name">set_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id3626002"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-ginterface">gobject.GInterface</PYGTKDOCLINK>
3
3
+-- <a class="link" href="class-gtkbuildable.html" title="gtk.Buildable">gtk.Buildable</a>
4
</pre></div><div class="refsect1" lang="en"><a name="id3357109"></a><h2>Known Implementation</h2><p>
4
</pre></div><div class="refsect1" title="Known Implementation"><a name="id3626026"></a><h2>Known Implementation</h2><p>
5
5
<a class="link" href="class-gtkbuildable.html" title="gtk.Buildable"><code class="classname">gtk.Buildable</code></a>
7
7
<a class="link" href="class-gtkbin.html" title="gtk.Bin"><code class="classname">gtk.Bin</code></a>,
129
129
The GtkBuildable interface is implemented by all widgets and many of the non-widget objects that are provided
130
130
by GTK+. The main user of this interface is GtkBuilder, there should be very little need for applications to
131
131
call any gtk.Buildable methods.
132
</p></div><div class="refsect1" lang="en"><a name="id3427749"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkbuildable--add-child"></a><h3>gtk.Buildable.add_child</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">add_child</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>builder</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>child</code></em></span></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"><strong class="parameter"><code>builder</code></strong> :</span></p></td><td>
132
</p></div><div class="refsect1" title="Methods"><a name="id3685999"></a><h2>Methods</h2><div class="refsect2" title="gtk.Buildable.add_child"><a name="method-gtkbuildable--add-child"></a><h3>gtk.Buildable.add_child</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">add_child</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>builder</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>child</code></em></span></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"><strong class="parameter"><code>builder</code></strong> :</span></p></td><td>
133
133
A <a class="link" href="class-gtkbuilder.html" title="gtk.Builder"><code class="classname">gtk.Builder</code></a>
134
134
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>child</code></strong> :</span></p></td><td>The child to add.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>type</code></strong> :</span></p></td><td>
135
135
The kind of <em class="parameter"><code>child</code></em> or <code class="literal">None</code>.
136
</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.12 and above.</p></div><p>
136
</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.12 and above.</p></div><p>
137
137
The <code class="methodname">add_child</code>() method adds a child to buildable. type is an
138
138
optional string describing how the child should be added.
139
</p></div><div class="refsect2" lang="en"><a name="method-gtkbuildable--construct-child"></a><h3>gtk.Buildable.construct_child</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">construct_child</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>builder</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>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"><strong class="parameter"><code>builder</code></strong> :</span></p></td><td>
139
</p></div><div class="refsect2" title="gtk.Buildable.construct_child"><a name="method-gtkbuildable--construct-child"></a><h3>gtk.Buildable.construct_child</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">construct_child</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>builder</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>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"><strong class="parameter"><code>builder</code></strong> :</span></p></td><td>
140
140
A <a class="link" href="class-gtkbuilder.html" title="gtk.Builder"><code class="classname">gtk.Builder</code></a>
141
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>name</code></strong> :</span></p></td><td>The name of child to construct.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>The constructed child.</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.12 and above.</p></div><p>
141
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>name</code></strong> :</span></p></td><td>The name of child to construct.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>The constructed child.</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.12 and above.</p></div><p>
142
142
The <code class="methodname">construct_child</code>() method constructs a child of buildable
143
143
with the name <em class="parameter"><code>name</code></em>.
145
145
GtkBuilder calls this function if a "constructor" has been specified in the UI definition.
146
</p></div><div class="refsect2" lang="en"><a name="method-gtkbuildable--get-internal-child"></a><h3>gtk.Buildable.get_internal_child</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_internal_child</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>builder</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>childname</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"><strong class="parameter"><code>builder</code></strong> :</span></p></td><td>
146
</p></div><div class="refsect2" title="gtk.Buildable.get_internal_child"><a name="method-gtkbuildable--get-internal-child"></a><h3>gtk.Buildable.get_internal_child</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_internal_child</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>builder</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>childname</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"><strong class="parameter"><code>builder</code></strong> :</span></p></td><td>
147
147
A <a class="link" href="class-gtkbuilder.html" title="gtk.Builder"><code class="classname">gtk.Builder</code></a>
148
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>childname</code></strong> :</span></p></td><td>The name of child.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>The internal child of the buildable object.</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.12 and above.</p></div><p>
148
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>childname</code></strong> :</span></p></td><td>The name of child.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>The internal child of the buildable object.</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.12 and above.</p></div><p>
149
149
The <code class="methodname">get_internal_child</code>() method gets the internal child
150
150
called childname of the buildable object.
151
</p></div><div class="refsect2" lang="en"><a name="method-gtkbuildable--get-name"></a><h3>gtk.Buildable.get_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_name</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>
151
</p></div><div class="refsect2" title="gtk.Buildable.get_name"><a name="method-gtkbuildable--get-name"></a><h3>gtk.Buildable.get_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_name</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>
152
152
The name set with
153
153
<code class="methodname"><a class="link" href="class-gtkbuildable.html#method-gtkbuildable--set-name" title="gtk.Buildable.set_name">set_name</a></code>
154
</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.12 and above.</p></div><p>
154
</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.12 and above.</p></div><p>
155
155
The <code class="methodname">get_name</code>() method gets the name of the buildable object.
157
157
GtkBuilder sets the name based on the the
158
158
<a class="link" href="class-gtkbuilder.html#gtkbuilder-ui-definition" title="gtk.Builder UI definition">GtkBuilder UI description</a>
159
159
used to construct the buildable.
160
</p></div><div class="refsect2" lang="en"><a name="method-gtkbuildable--parser-finished"></a><h3>gtk.Buildable.parser_finished</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">parser_finished</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>builder</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"><strong class="parameter"><code>builder</code></strong> :</span></p></td><td>
160
</p></div><div class="refsect2" title="gtk.Buildable.parser_finished"><a name="method-gtkbuildable--parser-finished"></a><h3>gtk.Buildable.parser_finished</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">parser_finished</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>builder</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"><strong class="parameter"><code>builder</code></strong> :</span></p></td><td>
161
161
A <a class="link" href="class-gtkbuilder.html" title="gtk.Builder"><code class="classname">gtk.Builder</code></a>
162
</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.12 and above.</p></div><p>
162
</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.12 and above.</p></div><p>
163
163
The <code class="methodname">parser_finished</code>() method is called when the builder finishes
164
164
the parsing of a GtkBuilder UI definition. Note that this will be called once for each
165
165
time <code class="methodname"><a class="link" href="class-gtkbuilder.html#method-gtkbuilder--add-from-file" title="gtk.Builder.add_from_file">add_from_file</a></code>
166
166
or <code class="methodname"><a class="link" href="class-gtkbuilder.html#method-gtkbuilder--add-from-string" title="gtk.Builder.add_from_string">add_from_string</a></code>
167
167
is called on a builder.
168
</p></div><div class="refsect2" lang="en"><a name="method-gtkbuildable--set-name"></a><h3>gtk.Buildable.set_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_name</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>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"><strong class="parameter"><code>name</code></strong> :</span></p></td><td>The name to set.</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.12 and above.</p></div><p>
168
</p></div><div class="refsect2" title="gtk.Buildable.set_name"><a name="method-gtkbuildable--set-name"></a><h3>gtk.Buildable.set_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_name</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>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"><strong class="parameter"><code>name</code></strong> :</span></p></td><td>The name to set.</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.12 and above.</p></div><p>
169
169
The <code class="methodname">set_name</code>() method sets the name of the buildable object.
170
170
</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-gtkbuilder.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-gtkbuttonbox.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.Builder </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.ButtonBox</td></tr></table></div></body></html>