File: class-gtkbuilder.html

package info (click to toggle)
pygtk 2.12.1-6
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 25,776 kB
  • ctags: 8,213
  • sloc: xml: 168,600; python: 14,328; sh: 9,131; ansic: 2,724; makefile: 1,141
file content (186 lines) | stat: -rw-r--r-- 27,925 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.Builder</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-gtkbutton.html" title="gtk.Button"><link rel="next" href="class-gtkbuildable.html" title="gtk.Buildable"></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.Builder</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkbutton.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkbuildable.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkbuilder"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.Builder</h2><p>gtk.Builder — Build an interface from an XML UI definition.</p></div><div class="refsect1" lang="en"><a name="id3159296"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.Builder</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>):
<code class="constructorsynopsis">    <span class="methodname"><a class="link" href="class-gtkbuilder.html#constructor-gtkbuilder" title="Constructor">gtk.Builder</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkbuilder.html#method-gtkbuilder--add-from-file" title="gtk.Builder.add_from_file">add_from_file</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filename</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkbuilder.html#method-gtkbuilder--add-from-string" title="gtk.Builder.add_from_string">add_from_string</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>buffer</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>len</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkbuilder.html#method-gtkbuilder--connect-signals" title="gtk.Builder.connect_signals">connect_signals</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>user_data</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkbuilder.html#method-gtkbuilder--get-object" title="gtk.Builder.get_object">get_object</a></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-gtkbuilder.html#method-gtkbuilder--get-objects" title="gtk.Builder.get_objects">get_objects</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkbuilder.html#method-gtkbuilder--get-translation-domain" title="gtk.Builder.get_translation_domain">get_translation_domain</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkbuilder.html#method-gtkbuilder--get-type-from-name" title="gtk.Builder.get_type_from_name">get_type_from_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>type_name</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkbuilder.html#method-gtkbuilder--set-translation-domain" title="gtk.Builder.set_translation_domain">set_translation_domain</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>domain</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3118528"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
  +-- <a class="link" href="class-gtkbuilder.html" title="gtk.Builder">gtk.Builder</a>
</pre></div><div class="refsect1" lang="en"><a name="properties-gtkbuilder"></a><h2>gtk.Builder Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"translation-domain"</td><td valign="top">Read/Write</td><td valign="top">The translation domain used when translating property
                            values that have been marked as translatable in interface descriptions.
                            If the translation domain is None, GtkBuilder uses gettext(),
                            otherwise dgettext(). Default value: None
                            </td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2965340"></a><h2>Description</h2><p>
            A <a class="link" href="class-gtkbuilder.html" title="gtk.Builder"><code class="classname">gtk.Builder</code></a>
            is an auxiliary object that reads textual descriptions of a user interface and
            instantiates the described objects. To pass a description to a
            <a class="link" href="class-gtkbuilder.html" title="gtk.Builder"><code class="classname">gtk.Builder</code></a>, call
            <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> 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>.
            These functions can be called multiple times; the builder merges the content of all descriptions.
        </p><p>
            A <a class="link" href="class-gtkbuilder.html" title="gtk.Builder"><code class="classname">gtk.Builder</code></a>
            holds a reference to all objects that it has constructed and drops these references
            when it is finalized. This finalization can cause the destruction of non-widget objects
            or widgets which are not contained in a toplevel window. For toplevel windows constructed
            by a builder, it is the responsibility of the user to call
            <code class="methodname"><a class="link" href="class-gtkwidget.html#method-gtkwidget--destroy" title="gtk.Widget.destroy">gtk.Widget.destroy</a></code>
            to get rid of them and all the widgets they contain.
        </p><p>
            The functions <code class="methodname"><a class="link" href="class-gtkbuilder.html#method-gtkbuilder--get-object" title="gtk.Builder.get_object">get_object</a></code>
            and <code class="methodname"><a class="link" href="class-gtkbuilder.html#method-gtkbuilder--get-objects" title="gtk.Builder.get_objects">get_objects</a></code>
            can be used to access the widgets in the interface by the names assigned to them inside the UI description.
            Toplevel windows returned by these functions will stay around until the user explicitly
            destroys them with gtk_widget_destroy(). Other widgets will either be part of a larger
            hierarchy constructed by the builder (in which case you should not have to worry about their
            lifecycle), or without a parent, in which case they have to be added to some container to make
            use of them.
        </p><p>
            The function <code class="methodname"><a class="link" href="class-gtkbuilder.html#method-gtkbuilder--connect-signals" title="gtk.Builder.connect_signals">connect_signals</a></code>
            and variants thereof can be used to connect handlers to the named signals in the description.
        </p><div class="refsect2" lang="en"><a name="gtkbuilder-ui-definition"></a><h3>gtk.Builder UI definition</h3><p>
                <a class="link" href="class-gtkbuilder.html" title="gtk.Builder"><code class="classname">gtk.Builder</code></a> parses textual
                descriptions of user interfaces which are specified in an XML format which
                can be roughly described by the DTD below. We refer to these descriptions as GtkBuilder UI definitions
                or just UI definitions if the context is clear. Do not confuse GtkBuilder UI Definitions with
                GtkUIManager UI Definitions, which are more limited in scope.
            </p><pre class="programlisting">

&lt;!ELEMENT interface object* &gt;
&lt;!ELEMENT object    (property|signal|child|ANY)* &gt;
&lt;!ELEMENT property  PCDATA &gt;
&lt;!ELEMENT signal    EMPTY &gt;
&lt;!ELEMENT child     (object|ANY*) &gt;

&lt;!ATTLIST interface  domain         	    #IMPLIED &gt;
&lt;!ATTLIST object     id             	    #REQUIRED
                     class          	    #IMPLIED
                     type-func      	    #IMPLIED
                     constructor    	    #IMPLIED &gt;
&lt;!ATTLIST property   name           	    #REQUIRED
                     translatable   	    #IMPLIED 
                     comments               #IMPLIED
                     context                #IMPLIED &gt;
&lt;!ATTLIST signal     name           	    #REQUIRED
                     handler        	    #REQUIRED
                     after          	    #IMPLIED
                     swapped        	    #IMPLIED
                     object         	    #IMPLIED
                     last_modification_time #IMPLIED &gt;
&lt;!ATTLIST child      type           	    #IMPLIED
                     internal-child 	    #IMPLIED &gt;

</pre><p>
                The toplevel element is &lt;interface&gt;. It optionally takes a "domain" attribute,
                which will make the builder look for translated strings using dgettext() in the domain
                specified. This can also be done by calling
                <code class="methodname"><a class="link" href="class-gtkbuilder.html#method-gtkbuilder--set-translation-domain" title="gtk.Builder.set_translation_domain">set_translation_domain</a></code>
                on the builder. Objects are described by &lt;object&gt; elements, which can contain &lt;property&gt;
                elements to set properties, &lt;signal&gt; elements which connect signals to handlers, and &lt;child&gt;
                elements, which describe child objects (most often widgets inside a container, but also e.g. actions
                in an action group, or columns in a tree model). A &lt;child&gt; element contains an &lt;object&gt;
                element which describes the child object.
            </p><p>
                Typically, the specific kind of object represented by an &lt;object&gt; element is specified by the
                "class" attribute. If the type has not been loaded yet, GTK+ tries to find the _get_type() from the
                class name by applying heuristics. This works in most cases, but if necessary, it is possible to specify
                the name of the _get_type() explictly with the "type-func" attribute. As a special case, GtkBuilder allows
                to use an object that has been constructed by a GtkUIManager in another part of the UI definition by
                specifying the id of the GtkUIManager in the "constructor" attribute and the name of the object
                in the "id" attribute.
            </p><p>
                Objects must be given a name with the "id" attribute, which allows the application to retrieve them from
                the builder with gtk_builder_get_object(). An id is also necessary to use the object as property
                value in other parts of the UI definition.
            </p><p>
                Setting properties of objects is pretty straightforward with the &lt;property&gt;element: the "name"
                attribute specifies the name of the property, and the content of the element specifies the value. If the
                "translatable" attribute is set to a true value, GTK+ uses gettext() (or dgettext() if the builder has
                a translation domain set) to find a translation for the value. This happens before the value is parsed,
                so it can be used for properties of any type, but it is probably most useful for string properties.
                It is also possible to specify a context to disambiguate short strings, and comments which may
                help the translators.
            </p><p>
                GtkBuilder can parse textual representations for the most common property types: characters, strings,
                integers, floating-point numbers, booleans (strings like "TRUE", "t", "yes", "y", "1" are interpreted as
                <code class="literal">True</code>, strings like "FALSE, "f", "no", "n", "0" are interpreted as <code class="literal">False</code>),
                enumerations (can be specified by their name, nick or integer value), flags (can be specified by their
                name, nick, integer value, optionally combined with "|", e.g. "gtk.VISIBLE|gtk.REALIZED")
                and colors (in a format understood by gdk_color_parse()). Objects can be referred to by their name.
                Pixbufs can be specified as a filename of an image file to load. In general, GtkBuilder allows
                forward references to objects — an object doesn't have to constructed before it can be referred to.
                The exception to this rule is that an object has to be constructed before it can be used as the value
                of a construct-only property.
            </p><p>
                Signal handlers are set up with the &lt;signal&gt; element. The "name" attribute specifies the name
                of the signal, and the "handler" attribute specifies the function to connect to the signal. By default,
                GTK+ tries to find the handler using g_module_symbol(), but this can be changed by passing a custom
                GtkBuilderConnectFunc to gtk_builder_connect_signals_full(). The remaining attributes, "after", "swapped"
                and "object", have the same meaning as the corresponding parameters of the g_signal_connect_object() or
                g_signal_connect_data() functions. A "last_modification_time" attribute is also allowed, but it does not
                have a meaning to the builder.
            </p><p>
                Sometimes it is necessary to refer to widgets which have implicitly been constructed by GTK+ as part of
                a composite widget, to set properties on them or to add further children (e.g. the vbox of a GtkDialog).
                This can be achieved by setting the "internal-child" propery of the &lt;child&gt; element to a true value.
                Note that GtkBuilder still requires an &lt;object&gt; element for the internal child, even if it has
                already been constructed.
            </p><p>
                A number of widgets have different places where a child can be added (e.g. tabs vs. page content in
                notebooks). This can be reflected in a UI definition by specifying the "type" attribute on a
                &lt;child&gt; The possible values for the "type" attribute are described in the sections describing
                the widget-specific portions of UI definitions.
            </p></div><div class="refsect2" lang="en"><a name="gtkbuilder-ui-definition-example"></a><h3>A gtk.Builder UI definition example</h3><pre class="programlisting">

&lt;interface&gt;
  &lt;object class="GtkDialog" id="dialog1"&gt;
    &lt;child internal-child="vbox"&gt;
      &lt;object class="GtkVBox" id="vbox1"&gt;
        &lt;property name="border-width"&gt;10&lt;/property&gt;
        &lt;child internal-child="action_area"&gt;
          &lt;object class="GtkHButtonBox" id="hbuttonbox1"&gt;
            &lt;property name="border-width"&gt;20&lt;/property&gt;
            &lt;child&gt;
              &lt;object class="GtkButton" id="ok_button"&gt;
                &lt;property name="label"&gt;gtk-ok&lt;/property&gt;
                &lt;property name="use-stock"&gt;TRUE&lt;/property&gt;
                &lt;signal name="clicked" handler="ok_button_clicked"/&gt;
              &lt;/object&gt;
            &lt;/child&gt;
          &lt;/object&gt;
        &lt;/child&gt;
      &lt;/object&gt;
    &lt;/child&gt;
  &lt;/object&gt;
&lt;/interface&gt;

</pre><p>
                Beyond this general structure, several object classes define their own XML DTD
                fragments for filling in the ANY placeholders in the DTD above. Note that a
                custom element in a &lt;child&gt; element gets parsed by the custom tag handler of
                the parent object, while a custom element in an &lt;object&gt; element gets parsed
                by the custom tag handler of the object.
            </p></div></div><div class="refsect1" lang="en"><a name="constructor-gtkbuilder"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.Builder</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>a new builder object.</td></tr></tbody></table><p>
            Creates a new builder object.
        </p></div><div class="refsect1" lang="en"><a name="id3157204"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkbuilder--add-from-file"></a><h3>gtk.Builder.add_from_file</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">add_from_file</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>filename</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>filename</code></strong> :</span></p></td><td>The name of the file to parse.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>A positive value on success, 0 if an error occurred.</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>
                The <code class="methodname">add_from_file</code>() method parses a file containing a GtkBuilder UI
                definition and merges it with the current contents of builder.
            </p></div><div class="refsect2" lang="en"><a name="method-gtkbuilder--add-from-string"></a><h3>gtk.Builder.add_from_string</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">add_from_string</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>buffer</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>len</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>buffer</code></strong> :</span></p></td><td>The string to parse.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>len</code></strong> :</span></p></td><td>The length of buffer (may be -1 if buffer is nul-terminated).</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>A positive value on success, 0 if an error occurred.</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>
                The <code class="methodname">add_from_string</code>() method parses a string containing a GtkBuilder UI
                definition and merges it with the current contents of builder.
            </p></div><div class="refsect2" lang="en"><a name="method-gtkbuilder--connect-signals"></a><h3>gtk.Builder.connect_signals</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">connect_signals</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>object</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_data</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>object</code></strong> :</span></p></td><td>A mapping or an instance.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>user_data</code></strong> :</span></p></td><td>User data for every signal handler.</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>
                The <code class="methodname">connect_signals</code>() method uses Python's introspective
                features to look at the keys (if object is a mapping) or attributes (if object is an instance)
                and tries to match them with the signal handler names given in the interface description.
                The callbacks referenced by each matched key or attribute are connected to their matching signals.
            </p></div><div class="refsect2" lang="en"><a name="method-gtkbuilder--get-object"></a><h3>gtk.Builder.get_object</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_object</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>Name of object to get.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>The object named name or None if it could
                        not be found in the object tree.</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>
                The <code class="methodname">get_object</code>() method gets the object named name.
            </p></div><div class="refsect2" lang="en"><a name="method-gtkbuilder--get-objects"></a><h3>gtk.Builder.get_objects</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_objects</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>A list containing all the objects constructed
                        by the GtkBuilder instance</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>
                The <code class="methodname">get_objects</code>() method gets all objects that have
                been constructed by builder.
            </p></div><div class="refsect2" lang="en"><a name="method-gtkbuilder--get-translation-domain"></a><h3>gtk.Builder.get_translation_domain</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_translation_domain</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>The translation domain.</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>
                The <code class="methodname">get_translation_domain</code>() gets the translation domain of builder.
            </p></div><div class="refsect2" lang="en"><a name="method-gtkbuilder--get-type-from-name"></a><h3>gtk.Builder.get_type_from_name</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_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"><strong class="parameter"><code>type_name</code></strong> :</span></p></td><td>The name to lookup.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>The GType found for type_name or G_TYPE_INVALID if no type was found</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>
                The <code class="methodname">get_type_from_name</code>() method looks up a type by name,
                using the virtual function that GtkBuilder has for that purpose.
            </p></div><div class="refsect2" lang="en"><a name="method-gtkbuilder--set-translation-domain"></a><h3>gtk.Builder.set_translation_domain</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_translation_domain</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>domain</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>domain</code></strong> :</span></p></td><td>The translation domain or None.</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>
                The <code class="methodname">set_translation_domain</code>() method sets the translation
                domain of builder. See GtkBuilder:translation-domain property.
            </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-gtkbutton.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-gtkbuildable.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.Button </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.Buildable</td></tr></table></div></body></html>