⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.10
Server IP:
157.245.101.34
Server:
Linux skvinfotech-website 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64
Server Software:
Apache/2.4.41 (Ubuntu)
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
doc
/
libgtk-3-dev
/
gtk3
/
View File Name :
GtkBuilder.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>GtkBuilder: GTK+ 3 Reference Manual</title> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="index.html" title="GTK+ 3 Reference Manual"> <link rel="up" href="Builder.html" title="Interface builder"> <link rel="prev" href="Builder.html" title="Interface builder"> <link rel="next" href="GtkBuildable.html" title="GtkBuildable"> <meta name="generator" content="GTK-Doc V1.32 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> <td width="100%" align="left" class="shortcuts"> <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> <a href="#GtkBuilder.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> <a href="#GtkBuilder.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties"> <span class="dim">|</span> <a href="#GtkBuilder.properties" class="shortcut">Properties</a></span> </td> <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> <td><a accesskey="u" href="Builder.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> <td><a accesskey="p" href="Builder.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> <td><a accesskey="n" href="GtkBuildable.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> </tr></table> <div class="refentry"> <a name="GtkBuilder"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2><span class="refentrytitle"><a name="GtkBuilder.top_of_page"></a>GtkBuilder</span></h2> <p>GtkBuilder — Build an interface from an XML UI definition</p> </td> <td class="gallery_image" valign="top" align="right"></td> </tr></table></div> <div class="refsect1"> <a name="GtkBuilder.functions"></a><h2>Functions</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="functions_proto_type"> <col class="functions_proto_name"> </colgroup> <tbody> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <span class="c_punctuation">(</span><a class="link" href="GtkBuilder.html#GtkBuilderConnectFunc" title="GtkBuilderConnectFunc ()">*GtkBuilderConnectFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="returnvalue">GtkBuilder</span></a> * </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-new" title="gtk_builder_new ()">gtk_builder_new</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="returnvalue">GtkBuilder</span></a> * </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-new-from-file" title="gtk_builder_new_from_file ()">gtk_builder_new_from_file</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="returnvalue">GtkBuilder</span></a> * </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-new-from-resource" title="gtk_builder_new_from_resource ()">gtk_builder_new_from_resource</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="returnvalue">GtkBuilder</span></a> * </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-new-from-string" title="gtk_builder_new_from_string ()">gtk_builder_new_from_string</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-add-callback-symbol" title="gtk_builder_add_callback_symbol ()">gtk_builder_add_callback_symbol</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-add-callback-symbols" title="gtk_builder_add_callback_symbols ()">gtk_builder_add_callback_symbols</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GCallback"><span class="returnvalue">GCallback</span></a> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-lookup-callback-symbol" title="gtk_builder_lookup_callback_symbol ()">gtk_builder_lookup_callback_symbol</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-add-from-file" title="gtk_builder_add_from_file ()">gtk_builder_add_from_file</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-add-from-resource" title="gtk_builder_add_from_resource ()">gtk_builder_add_from_resource</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-add-from-string" title="gtk_builder_add_from_string ()">gtk_builder_add_from_string</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-add-objects-from-file" title="gtk_builder_add_objects_from_file ()">gtk_builder_add_objects_from_file</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-add-objects-from-string" title="gtk_builder_add_objects_from_string ()">gtk_builder_add_objects_from_string</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-add-objects-from-resource" title="gtk_builder_add_objects_from_resource ()">gtk_builder_add_objects_from_resource</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-extend-with-template" title="gtk_builder_extend_with_template ()">gtk_builder_extend_with_template</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct"><span class="returnvalue">GObject</span></a> * </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-get-object" title="gtk_builder_get_object ()">gtk_builder_get_object</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-get-objects" title="gtk_builder_get_objects ()">gtk_builder_get_objects</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-expose-object" title="gtk_builder_expose_object ()">gtk_builder_expose_object</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals" title="gtk_builder_connect_signals ()">gtk_builder_connect_signals</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals-full" title="gtk_builder_connect_signals_full ()">gtk_builder_connect_signals_full</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-set-translation-domain" title="gtk_builder_set_translation_domain ()">gtk_builder_set_translation_domain</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-get-translation-domain" title="gtk_builder_get_translation_domain ()">gtk_builder_get_translation_domain</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-set-application" title="gtk_builder_set_application ()">gtk_builder_set_application</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GtkApplication.html" title="GtkApplication"><span class="returnvalue">GtkApplication</span></a> * </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-get-application" title="gtk_builder_get_application ()">gtk_builder_get_application</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-get-type-from-name" title="gtk_builder_get_type_from_name ()">gtk_builder_get_type_from_name</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-value-from-string" title="gtk_builder_value_from_string ()">gtk_builder_value_from_string</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> </td> <td class="function_name"> <a class="link" href="GtkBuilder.html#gtk-builder-value-from-string-type" title="gtk_builder_value_from_string_type ()">gtk_builder_value_from_string_type</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"> <a class="link" href="GtkBuilder.html#GTK-BUILDER-WARN-INVALID-CHILD-TYPE:CAPS" title="GTK_BUILDER_WARN_INVALID_CHILD_TYPE()">GTK_BUILDER_WARN_INVALID_CHILD_TYPE</a><span class="c_punctuation">()</span> </td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="GtkBuilder.properties"></a><h2>Properties</h2> <div class="informaltable"><table class="informaltable" border="0"> <colgroup> <col width="150px" class="properties_type"> <col width="300px" class="properties_name"> <col width="200px" class="properties_flags"> </colgroup> <tbody><tr> <td class="property_type"> <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</td> <td class="property_name"><a class="link" href="GtkBuilder.html#GtkBuilder--translation-domain" title="The “translation-domain” property">translation-domain</a></td> <td class="property_flags">Read / Write</td> </tr></tbody> </table></div> </div> <div class="refsect1"> <a name="GtkBuilder.other"></a><h2>Types and Values</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="other_proto_type"> <col class="other_proto_name"> </colgroup> <tbody> <tr> <td class="datatype_keyword"> </td> <td class="function_name"><a class="link" href="GtkBuilder.html#GtkBuilder-struct" title="GtkBuilder">GtkBuilder</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="GtkBuilder.html#GtkBuilderError" title="enum GtkBuilderError">GtkBuilderError</a></td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR">GTK_BUILDER_ERROR</a></td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="GtkBuilder.object-hierarchy"></a><h2>Object Hierarchy</h2> <pre class="screen"> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a> <span class="lineart">╰──</span> GtkBuilder </pre> </div> <div class="refsect1"> <a name="GtkBuilder.includes"></a><h2>Includes</h2> <pre class="synopsis">#include <gtk/gtk.h> </pre> </div> <div class="refsect1"> <a name="GtkBuilder.description"></a><h2>Description</h2> <p>A GtkBuilder is an auxiliary object that reads textual descriptions of a user interface and instantiates the described objects. To create a GtkBuilder from a user interface description, call <a class="link" href="GtkBuilder.html#gtk-builder-new-from-file" title="gtk_builder_new_from_file ()"><code class="function">gtk_builder_new_from_file()</code></a>, <a class="link" href="GtkBuilder.html#gtk-builder-new-from-resource" title="gtk_builder_new_from_resource ()"><code class="function">gtk_builder_new_from_resource()</code></a> or <a class="link" href="GtkBuilder.html#gtk-builder-new-from-string" title="gtk_builder_new_from_string ()"><code class="function">gtk_builder_new_from_string()</code></a>.</p> <p>In the (unusual) case that you want to add user interface descriptions from multiple sources to the same GtkBuilder you can call <a class="link" href="GtkBuilder.html#gtk-builder-new" title="gtk_builder_new ()"><code class="function">gtk_builder_new()</code></a> to get an empty builder and populate it by (multiple) calls to <a class="link" href="GtkBuilder.html#gtk-builder-add-from-file" title="gtk_builder_add_from_file ()"><code class="function">gtk_builder_add_from_file()</code></a>, <a class="link" href="GtkBuilder.html#gtk-builder-add-from-resource" title="gtk_builder_add_from_resource ()"><code class="function">gtk_builder_add_from_resource()</code></a> or <a class="link" href="GtkBuilder.html#gtk-builder-add-from-string" title="gtk_builder_add_from_string ()"><code class="function">gtk_builder_add_from_string()</code></a>.</p> <p>A GtkBuilder 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 <a class="link" href="GtkWidget.html#gtk-widget-destroy" title="gtk_widget_destroy ()"><code class="function">gtk_widget_destroy()</code></a> to get rid of them and all the widgets they contain.</p> <p>The functions <a class="link" href="GtkBuilder.html#gtk-builder-get-object" title="gtk_builder_get_object ()"><code class="function">gtk_builder_get_object()</code></a> and <a class="link" href="GtkBuilder.html#gtk-builder-get-objects" title="gtk_builder_get_objects ()"><code class="function">gtk_builder_get_objects()</code></a> 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 <a class="link" href="GtkWidget.html#gtk-widget-destroy" title="gtk_widget_destroy ()"><code class="function">gtk_widget_destroy()</code></a>. 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. Non-widget objects need to be reffed with <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-ref"><code class="function">g_object_ref()</code></a> to keep them beyond the lifespan of the builder.</p> <p>The function <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals" title="gtk_builder_connect_signals ()"><code class="function">gtk_builder_connect_signals()</code></a> and variants thereof can be used to connect handlers to the named signals in the description.</p> <div class="refsect2"> <a name="BUILDER-UI"></a><h3>GtkBuilder UI Definitions</h3> <p>GtkBuilder parses textual descriptions of user interfaces which are specified in an XML format which can be roughly described by the RELAX NG schema 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 <a class="link" href="GtkUIManager.html#XML-UI" title="UI Definitions">GtkUIManager UI Definitions</a>, which are more limited in scope. It is common to use <code class="literal">.ui</code> as the filename extension for files containing GtkBuilder UI definitions.</p> <p><a class="ulink" href="https://git.gnome.org/browse/gtk+/tree/gtk/gtkbuilder.rnc" target="_top">RELAX NG Compact Syntax</a></p> <p>The toplevel element is <interface>. It optionally takes a “domain” attribute, which will make the builder look for translated strings using <code class="function">dgettext()</code> in the domain specified. This can also be done by calling <a class="link" href="GtkBuilder.html#gtk-builder-set-translation-domain" title="gtk_builder_set_translation_domain ()"><code class="function">gtk_builder_set_translation_domain()</code></a> on the builder. Objects are described by <object> elements, which can contain <property> elements to set properties, <signal> elements which connect signals to handlers, and <child> 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 <child> element contains an <object> element which describes the child object. The target toolkit version(s) are described by <requires> elements, the “lib” attribute specifies the widget library in question (currently the only supported value is “gtk+”) and the “version” attribute specifies the target version in the form “<major>.<minor>”. The builder will error out if the version requirements are not met.</p> <p>Typically, the specific kind of object represented by an <object> element is specified by the “class” attribute. If the type has not been loaded yet, GTK+ tries to find the <code class="function">get_type()</code> function from the class name by applying heuristics. This works in most cases, but if necessary, it is possible to specify the name of the <code class="function">get_type()</code> function explictly with the "type-func" attribute. As a special case, GtkBuilder allows to use an object that has been constructed by a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> in another part of the UI definition by specifying the id of the <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> in the “constructor” attribute and the name of the object in the “id” attribute.</p> <p>Objects may be given a name with the “id” attribute, which allows the application to retrieve them from the builder with <a class="link" href="GtkBuilder.html#gtk-builder-get-object" title="gtk_builder_get_object ()"><code class="function">gtk_builder_get_object()</code></a>. An id is also necessary to use the object as property value in other parts of the UI definition. GTK+ reserves ids starting and ending with ___ (3 underscores) for its own purposes.</p> <p>Setting properties of objects is pretty straightforward with the <property> 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 <code class="function">gettext()</code> (or <code class="function">dgettext()</code> 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 <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, strings like “FALSE”, “f”, “no”, “n”, “0” are interpreted as <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>), 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 <a href="../html/gdk3-RGBA-Colors.html#gdk-rgba-parse"><code class="function">gdk_rgba_parse()</code></a>).</p> <p>GVariants can be specified in the format understood by <a href="/usr/share/gtk-doc/html/glib/glib-GVariant.html#g-variant-parse"><code class="function">g_variant_parse()</code></a>, and pixbufs can be specified as a filename of an image file to load.</p> <p>Objects can be referred to by their name and by default refer to objects declared in the local xml fragment and objects exposed via <a class="link" href="GtkBuilder.html#gtk-builder-expose-object" title="gtk_builder_expose_object ()"><code class="function">gtk_builder_expose_object()</code></a>. In general, GtkBuilder allows forward references to objects — declared in the local xml; an object doesn’t have to be 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>It is also possible to bind a property value to another object's property value using the attributes "bind-source" to specify the source object of the binding, "bind-property" to specify the source property and optionally "bind-flags" to specify the binding flags. Internally builder implements this using GBinding objects. For more information see <a href="/usr/share/gtk-doc/html/gobject/GBinding.html#g-object-bind-property"><code class="function">g_object_bind_property()</code></a></p> <p>Signal handlers are set up with the <signal> 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 <a href="/usr/share/gtk-doc/html/glib/glib-Dynamic-Loading-of-Modules.html#g-module-symbol"><code class="function">g_module_symbol()</code></a>, but this can be changed by passing a custom <a class="link" href="GtkBuilder.html#GtkBuilderConnectFunc" title="GtkBuilderConnectFunc ()"><span class="type">GtkBuilderConnectFunc</span></a> to <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals-full" title="gtk_builder_connect_signals_full ()"><code class="function">gtk_builder_connect_signals_full()</code></a>. The remaining attributes, “after”, “swapped” and “object”, have the same meaning as the corresponding parameters of the <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect-object"><code class="function">g_signal_connect_object()</code></a> or <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect-data"><code class="function">g_signal_connect_data()</code></a> 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 <em class="parameter"><code>vbox</code></em> of a <a class="link" href="GtkDialog.html" title="GtkDialog"><span class="type">GtkDialog</span></a>). This can be achieved by setting the “internal-child” property of the <child> element to a true value. Note that GtkBuilder still requires an <object> 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 <child> The possible values for the “type” attribute are described in the sections describing the widget-specific portions of UI definitions.</p> </div> <hr> <div class="refsect2"> <a name="id-1.3.5.2.8.8"></a><h3>A GtkBuilder UI Definition</h3> <div class="informalexample"> <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="listing_lines" align="right"><pre>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21</pre></td> <td class="listing_code"><pre class="programlisting"><span class="o"><</span><span class="n">interface</span><span class="o">></span> <span class="o"><</span><span class="n">object</span> <span class="n">class</span><span class="o">=</span><span class="s">"GtkDialog"</span> <span class="n">id</span><span class="o">=</span><span class="s">"dialog1"</span><span class="o">></span> <span class="o"><</span><span class="n">child</span> <span class="n">internal</span><span class="o">-</span><span class="n">child</span><span class="o">=</span><span class="s">"vbox"</span><span class="o">></span> <span class="o"><</span><span class="n">object</span> <span class="n">class</span><span class="o">=</span><span class="s">"GtkBox"</span> <span class="n">id</span><span class="o">=</span><span class="s">"vbox1"</span><span class="o">></span> <span class="o"><</span><span class="n">property</span> <span class="n">name</span><span class="o">=</span><span class="s">"border-width"</span><span class="o">></span><span class="mi">10</span><span class="o"></</span><span class="n">property</span><span class="o">></span> <span class="o"><</span><span class="n">child</span> <span class="n">internal</span><span class="o">-</span><span class="n">child</span><span class="o">=</span><span class="s">"action_area"</span><span class="o">></span> <span class="o"><</span><span class="n">object</span> <span class="n">class</span><span class="o">=</span><span class="s">"GtkButtonBox"</span> <span class="n">id</span><span class="o">=</span><span class="s">"hbuttonbox1"</span><span class="o">></span> <span class="o"><</span><span class="n">property</span> <span class="n">name</span><span class="o">=</span><span class="s">"border-width"</span><span class="o">></span><span class="mi">20</span><span class="o"></</span><span class="n">property</span><span class="o">></span> <span class="o"><</span><span class="n">child</span><span class="o">></span> <span class="o"><</span><span class="n">object</span> <span class="n">class</span><span class="o">=</span><span class="s">"GtkButton"</span> <span class="n">id</span><span class="o">=</span><span class="s">"ok_button"</span><span class="o">></span> <span class="o"><</span><span class="n">property</span> <span class="n">name</span><span class="o">=</span><span class="s">"label"</span><span class="o">></span><span class="n">gtk</span><span class="o">-</span><span class="n">ok</span><span class="o"></</span><span class="n">property</span><span class="o">></span> <span class="o"><</span><span class="n">property</span> <span class="n">name</span><span class="o">=</span><span class="s">"use-stock"</span><span class="o">></span><span class="n">TRUE</span><span class="o"></</span><span class="n">property</span><span class="o">></span> <span class="o"><</span><span class="n">signal</span> <span class="n">name</span><span class="o">=</span><span class="s">"clicked"</span> <span class="n">handler</span><span class="o">=</span><span class="s">"ok_button_clicked"</span><span class="o">/></span> <span class="o"></</span><span class="n">object</span><span class="o">></span> <span class="o"></</span><span class="n">child</span><span class="o">></span> <span class="o"></</span><span class="n">object</span><span class="o">></span> <span class="o"></</span><span class="n">child</span><span class="o">></span> <span class="o"></</span><span class="n">object</span><span class="o">></span> <span class="o"></</span><span class="n">child</span><span class="o">></span> <span class="o"></</span><span class="n">object</span><span class="o">></span> <span class="o"></</span><span class="n">interface</span><span class="o">></span></pre></td> </tr> </tbody> </table> </div> <p></p> <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 <child> element gets parsed by the custom tag handler of the parent object, while a custom element in an <object> element gets parsed by the custom tag handler of the object.</p> <p>These XML fragments are explained in the documentation of the respective objects.</p> <p>Additionally, since 3.10 a special <template> tag has been added to the format allowing one to define a widget class’s components. See the <a class="link" href="GtkWidget.html#composite-templates" title="Building composite widgets from template XML">GtkWidget documentation</a> for details.</p> </div> </div> <div class="refsect1"> <a name="GtkBuilder.functions_details"></a><h2>Functions</h2> <div class="refsect2"> <a name="GtkBuilderConnectFunc"></a><h3>GtkBuilderConnectFunc ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> <span class="c_punctuation">(</span>*GtkBuilderConnectFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> *object</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *signal_name</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *handler_name</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> *connect_object</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#GConnectFlags"><span class="type">GConnectFlags</span></a> flags</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre> <p>This is the signature of a function used to connect signals. It is used by the <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals" title="gtk_builder_connect_signals ()"><code class="function">gtk_builder_connect_signals()</code></a> and <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals-full" title="gtk_builder_connect_signals_full ()"><code class="function">gtk_builder_connect_signals_full()</code></a> methods. It is mainly intended for interpreted language bindings, but could be useful where the programmer wants more control over the signal connection process. Note that this function can only be called once, subsequent calls will do nothing.</p> <div class="refsect3"> <a name="GtkBuilderConnectFunc.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object</p></td> <td class="parameter_description"><p>object to connect a signal to</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>signal_name</p></td> <td class="parameter_description"><p>name of the signal</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>handler_name</p></td> <td class="parameter_description"><p>name of the handler</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>connect_object</p></td> <td class="parameter_description"><p>a <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a>, if non-<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, use <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect-object"><code class="function">g_signal_connect_object()</code></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#GConnectFlags"><span class="type">GConnectFlags</span></a> to use</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>user data</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: 2.12</p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-new"></a><h3>gtk_builder_new ()</h3> <pre class="programlisting"><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="returnvalue">GtkBuilder</span></a> * gtk_builder_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> <p>Creates a new empty builder object.</p> <p>This function is only useful if you intend to make multiple calls to <a class="link" href="GtkBuilder.html#gtk-builder-add-from-file" title="gtk_builder_add_from_file ()"><code class="function">gtk_builder_add_from_file()</code></a>, <a class="link" href="GtkBuilder.html#gtk-builder-add-from-resource" title="gtk_builder_add_from_resource ()"><code class="function">gtk_builder_add_from_resource()</code></a> or <a class="link" href="GtkBuilder.html#gtk-builder-add-from-string" title="gtk_builder_add_from_string ()"><code class="function">gtk_builder_add_from_string()</code></a> in order to merge multiple UI descriptions into a single builder.</p> <p>Most users will probably want to use <a class="link" href="GtkBuilder.html#gtk-builder-new-from-file" title="gtk_builder_new_from_file ()"><code class="function">gtk_builder_new_from_file()</code></a>, <a class="link" href="GtkBuilder.html#gtk-builder-new-from-resource" title="gtk_builder_new_from_resource ()"><code class="function">gtk_builder_new_from_resource()</code></a> or <a class="link" href="GtkBuilder.html#gtk-builder-new-from-string" title="gtk_builder_new_from_string ()"><code class="function">gtk_builder_new_from_string()</code></a>.</p> <div class="refsect3"> <a name="gtk-builder-new.returns"></a><h4>Returns</h4> <p> a new (empty) <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> object</p> </div> <p class="since">Since: 2.12</p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-new-from-file"></a><h3>gtk_builder_new_from_file ()</h3> <pre class="programlisting"><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="returnvalue">GtkBuilder</span></a> * gtk_builder_new_from_file (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>);</pre> <p>Builds the <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder UI definition</a> in the file <em class="parameter"><code>filename</code></em> .</p> <p>If there is an error opening the file or parsing the description then the program will be aborted. You should only ever attempt to parse user interface descriptions that are shipped as part of your program.</p> <div class="refsect3"> <a name="gtk-builder-new-from-file.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>filename</p></td> <td class="parameter_description"><p>filename of user interface description file</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-new-from-file.returns"></a><h4>Returns</h4> <p> a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> containing the described interface</p> </div> <p class="since">Since: <a class="link" href="api-index-3-10.html#api-index-3.10">3.10</a></p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-new-from-resource"></a><h3>gtk_builder_new_from_resource ()</h3> <pre class="programlisting"><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="returnvalue">GtkBuilder</span></a> * gtk_builder_new_from_resource (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *resource_path</code></em>);</pre> <p>Builds the <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder UI definition</a> at <em class="parameter"><code>resource_path</code></em> .</p> <p>If there is an error locating the resource or parsing the description, then the program will be aborted.</p> <div class="refsect3"> <a name="gtk-builder-new-from-resource.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>resource_path</p></td> <td class="parameter_description"><p>a <a href="/usr/share/gtk-doc/html/gio/GResource.html#GResource-struct"><span class="type">GResource</span></a> resource path</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-new-from-resource.returns"></a><h4>Returns</h4> <p> a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> containing the described interface</p> </div> <p class="since">Since: <a class="link" href="api-index-3-10.html#api-index-3.10">3.10</a></p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-new-from-string"></a><h3>gtk_builder_new_from_string ()</h3> <pre class="programlisting"><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="returnvalue">GtkBuilder</span></a> * gtk_builder_new_from_string (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> length</code></em>);</pre> <p>Builds the user interface described by <em class="parameter"><code>string</code></em> (in the <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder UI definition</a> format).</p> <p>If <em class="parameter"><code>string</code></em> is <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated, then <em class="parameter"><code>length</code></em> should be -1. If <em class="parameter"><code>length</code></em> is not -1, then it is the length of <em class="parameter"><code>string</code></em> .</p> <p>If there is an error parsing <em class="parameter"><code>string</code></em> then the program will be aborted. You should not attempt to parse user interface description from untrusted sources.</p> <div class="refsect3"> <a name="gtk-builder-new-from-string.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>string</p></td> <td class="parameter_description"><p>a user interface (XML) description</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>length</p></td> <td class="parameter_description"><p>the length of <em class="parameter"><code>string</code></em> , or -1</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-new-from-string.returns"></a><h4>Returns</h4> <p> a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> containing the interface described by <em class="parameter"><code>string</code></em> </p> </div> <p class="since">Since: <a class="link" href="api-index-3-10.html#api-index-3.10">3.10</a></p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-add-callback-symbol"></a><h3>gtk_builder_add_callback_symbol ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> gtk_builder_add_callback_symbol (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *callback_name</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GCallback"><span class="type">GCallback</span></a> callback_symbol</code></em>);</pre> <p>Adds the <em class="parameter"><code>callback_symbol</code></em> to the scope of <em class="parameter"><code>builder</code></em> under the given <em class="parameter"><code>callback_name</code></em> .</p> <p>Using this function overrides the behavior of <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals" title="gtk_builder_connect_signals ()"><code class="function">gtk_builder_connect_signals()</code></a> for any callback symbols that are added. Using this method allows for better encapsulation as it does not require that callback symbols be declared in the global namespace.</p> <div class="refsect3"> <a name="gtk-builder-add-callback-symbol.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>callback_name</p></td> <td class="parameter_description"><p>The name of the callback, as expected in the XML</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>callback_symbol</p></td> <td class="parameter_description"><p>The callback pointer. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-3-10.html#api-index-3.10">3.10</a></p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-add-callback-symbols"></a><h3>gtk_builder_add_callback_symbols ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> gtk_builder_add_callback_symbols (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *first_callback_name</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GCallback"><span class="type">GCallback</span></a> first_callback_symbol</code></em>, <em class="parameter"><code>...</code></em>);</pre> <p>A convenience function to add many callbacks instead of calling <a class="link" href="GtkBuilder.html#gtk-builder-add-callback-symbol" title="gtk_builder_add_callback_symbol ()"><code class="function">gtk_builder_add_callback_symbol()</code></a> for each symbol.</p> <div class="refsect3"> <a name="gtk-builder-add-callback-symbols.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>first_callback_name</p></td> <td class="parameter_description"><p>The name of the callback, as expected in the XML</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>first_callback_symbol</p></td> <td class="parameter_description"><p>The callback pointer. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>...</p></td> <td class="parameter_description"><p>A list of callback name and callback symbol pairs terminated with <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-3-10.html#api-index-3.10">3.10</a></p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-lookup-callback-symbol"></a><h3>gtk_builder_lookup_callback_symbol ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GCallback"><span class="returnvalue">GCallback</span></a> gtk_builder_lookup_callback_symbol (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *callback_name</code></em>);</pre> <p>Fetches a symbol previously added to <em class="parameter"><code>builder</code></em> with <a class="link" href="GtkBuilder.html#gtk-builder-add-callback-symbols" title="gtk_builder_add_callback_symbols ()"><code class="function">gtk_builder_add_callback_symbols()</code></a></p> <p>This function is intended for possible use in language bindings or for any case that one might be cusomizing signal connections using <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals-full" title="gtk_builder_connect_signals_full ()"><code class="function">gtk_builder_connect_signals_full()</code></a></p> <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p> <div class="refsect3"> <a name="gtk-builder-lookup-callback-symbol.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>callback_name</p></td> <td class="parameter_description"><p>The name of the callback</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-lookup-callback-symbol.returns"></a><h4>Returns</h4> <p>The callback symbol in <em class="parameter"><code>builder</code></em> for <em class="parameter"><code>callback_name</code></em> , or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p> <p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-3-10.html#api-index-3.10">3.10</a></p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-add-from-file"></a><h3>gtk_builder_add_from_file ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_builder_add_from_file (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> <p>Parses a file containing a <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder UI definition</a> and merges it with the current contents of <em class="parameter"><code>builder</code></em> .</p> <p>Most users will probably want to use <a class="link" href="GtkBuilder.html#gtk-builder-new-from-file" title="gtk_builder_new_from_file ()"><code class="function">gtk_builder_new_from_file()</code></a>.</p> <p>If an error occurs, 0 will be returned and <em class="parameter"><code>error</code></em> will be assigned a <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a>, <a href="/usr/share/gtk-doc/html/glib/glib-Simple-XML-Subset-Parser.html#G-MARKUP-ERROR:CAPS"><span class="type">G_MARKUP_ERROR</span></a> or <a href="/usr/share/gtk-doc/html/glib/glib-File-Utilities.html#G-FILE-ERROR:CAPS"><span class="type">G_FILE_ERROR</span></a> domain.</p> <p>It’s not really reasonable to attempt to handle failures of this call. You should not use this function with untrusted files (ie: files that are not part of your application). Broken <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> files can easily crash your program, and it’s possible that memory was leaked leading up to the reported failure. The only reasonable thing to do when an error is detected is to call <a href="/usr/share/gtk-doc/html/glib/glib-Message-Logging.html#g-error"><code class="function">g_error()</code></a>.</p> <div class="refsect3"> <a name="gtk-builder-add-from-file.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>filename</p></td> <td class="parameter_description"><p>the name of the file to parse</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for an error, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-add-from-file.returns"></a><h4>Returns</h4> <p> A positive value on success, 0 if an error occurred</p> </div> <p class="since">Since: 2.12</p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-add-from-resource"></a><h3>gtk_builder_add_from_resource ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_builder_add_from_resource (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *resource_path</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> <p>Parses a resource file containing a <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder UI definition</a> and merges it with the current contents of <em class="parameter"><code>builder</code></em> .</p> <p>Most users will probably want to use <a class="link" href="GtkBuilder.html#gtk-builder-new-from-resource" title="gtk_builder_new_from_resource ()"><code class="function">gtk_builder_new_from_resource()</code></a>.</p> <p>If an error occurs, 0 will be returned and <em class="parameter"><code>error</code></em> will be assigned a <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a>, <a href="/usr/share/gtk-doc/html/glib/glib-Simple-XML-Subset-Parser.html#G-MARKUP-ERROR:CAPS"><span class="type">G_MARKUP_ERROR</span></a> or <a href="/usr/share/gtk-doc/html/gio/GResource.html#G-RESOURCE-ERROR:CAPS"><span class="type">G_RESOURCE_ERROR</span></a> domain.</p> <p>It’s not really reasonable to attempt to handle failures of this call. The only reasonable thing to do when an error is detected is to call <a href="/usr/share/gtk-doc/html/glib/glib-Message-Logging.html#g-error"><code class="function">g_error()</code></a>.</p> <div class="refsect3"> <a name="gtk-builder-add-from-resource.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>resource_path</p></td> <td class="parameter_description"><p>the path of the resource file to parse</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for an error, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-add-from-resource.returns"></a><h4>Returns</h4> <p> A positive value on success, 0 if an error occurred</p> </div> <p class="since">Since: <a class="link" href="api-index-3-4.html#api-index-3.4">3.4</a></p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-add-from-string"></a><h3>gtk_builder_add_from_string ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_builder_add_from_string (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> <p>Parses a string containing a <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder UI definition</a> and merges it with the current contents of <em class="parameter"><code>builder</code></em> .</p> <p>Most users will probably want to use <a class="link" href="GtkBuilder.html#gtk-builder-new-from-string" title="gtk_builder_new_from_string ()"><code class="function">gtk_builder_new_from_string()</code></a>.</p> <p>Upon errors 0 will be returned and <em class="parameter"><code>error</code></em> will be assigned a <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a>, <a href="/usr/share/gtk-doc/html/glib/glib-Simple-XML-Subset-Parser.html#G-MARKUP-ERROR:CAPS"><span class="type">G_MARKUP_ERROR</span></a> or <a href="/usr/share/gtk-doc/html/glib/glib-GVariant.html#G-VARIANT-PARSE-ERROR:CAPS"><span class="type">G_VARIANT_PARSE_ERROR</span></a> domain.</p> <p>It’s not really reasonable to attempt to handle failures of this call. The only reasonable thing to do when an error is detected is to call <a href="/usr/share/gtk-doc/html/glib/glib-Message-Logging.html#g-error"><code class="function">g_error()</code></a>.</p> <div class="refsect3"> <a name="gtk-builder-add-from-string.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>buffer</p></td> <td class="parameter_description"><p>the string to parse</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>length</p></td> <td class="parameter_description"><p>the length of <em class="parameter"><code>buffer</code></em> (may be -1 if <em class="parameter"><code>buffer</code></em> is nul-terminated)</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for an error, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-add-from-string.returns"></a><h4>Returns</h4> <p> A positive value on success, 0 if an error occurred</p> </div> <p class="since">Since: 2.12</p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-add-objects-from-file"></a><h3>gtk_builder_add_objects_from_file ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_builder_add_objects_from_file (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **object_ids</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> <p>Parses a file containing a <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder UI definition</a> building only the requested objects and merges them with the current contents of <em class="parameter"><code>builder</code></em> .</p> <p>Upon errors 0 will be returned and <em class="parameter"><code>error</code></em> will be assigned a <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a>, <a href="/usr/share/gtk-doc/html/glib/glib-Simple-XML-Subset-Parser.html#G-MARKUP-ERROR:CAPS"><span class="type">G_MARKUP_ERROR</span></a> or <a href="/usr/share/gtk-doc/html/glib/glib-File-Utilities.html#G-FILE-ERROR:CAPS"><span class="type">G_FILE_ERROR</span></a> domain.</p> <p>If you are adding an object that depends on an object that is not its child (for instance a <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a> that depends on its <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>), you have to explicitly list all of them in <em class="parameter"><code>object_ids</code></em> .</p> <div class="refsect3"> <a name="gtk-builder-add-objects-from-file.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>filename</p></td> <td class="parameter_description"><p>the name of the file to parse</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object_ids</p></td> <td class="parameter_description"><p>nul-terminated array of objects to build. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for an error, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-add-objects-from-file.returns"></a><h4>Returns</h4> <p> A positive value on success, 0 if an error occurred</p> </div> <p class="since">Since: 2.14</p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-add-objects-from-string"></a><h3>gtk_builder_add_objects_from_string ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_builder_add_objects_from_string (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **object_ids</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> <p>Parses a string containing a <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder UI definition</a> building only the requested objects and merges them with the current contents of <em class="parameter"><code>builder</code></em> .</p> <p>Upon errors 0 will be returned and <em class="parameter"><code>error</code></em> will be assigned a <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a> or <a href="/usr/share/gtk-doc/html/glib/glib-Simple-XML-Subset-Parser.html#G-MARKUP-ERROR:CAPS"><span class="type">G_MARKUP_ERROR</span></a> domain.</p> <p>If you are adding an object that depends on an object that is not its child (for instance a <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a> that depends on its <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>), you have to explicitly list all of them in <em class="parameter"><code>object_ids</code></em> .</p> <div class="refsect3"> <a name="gtk-builder-add-objects-from-string.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>buffer</p></td> <td class="parameter_description"><p>the string to parse</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>length</p></td> <td class="parameter_description"><p>the length of <em class="parameter"><code>buffer</code></em> (may be -1 if <em class="parameter"><code>buffer</code></em> is nul-terminated)</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object_ids</p></td> <td class="parameter_description"><p>nul-terminated array of objects to build. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for an error, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-add-objects-from-string.returns"></a><h4>Returns</h4> <p> A positive value on success, 0 if an error occurred</p> </div> <p class="since">Since: 2.14</p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-add-objects-from-resource"></a><h3>gtk_builder_add_objects_from_resource ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_builder_add_objects_from_resource (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *resource_path</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **object_ids</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> <p>Parses a resource file containing a <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder UI definition</a> building only the requested objects and merges them with the current contents of <em class="parameter"><code>builder</code></em> .</p> <p>Upon errors 0 will be returned and <em class="parameter"><code>error</code></em> will be assigned a <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a>, <a href="/usr/share/gtk-doc/html/glib/glib-Simple-XML-Subset-Parser.html#G-MARKUP-ERROR:CAPS"><span class="type">G_MARKUP_ERROR</span></a> or <a href="/usr/share/gtk-doc/html/gio/GResource.html#G-RESOURCE-ERROR:CAPS"><span class="type">G_RESOURCE_ERROR</span></a> domain.</p> <p>If you are adding an object that depends on an object that is not its child (for instance a <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a> that depends on its <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>), you have to explicitly list all of them in <em class="parameter"><code>object_ids</code></em> .</p> <div class="refsect3"> <a name="gtk-builder-add-objects-from-resource.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>resource_path</p></td> <td class="parameter_description"><p>the path of the resource file to parse</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object_ids</p></td> <td class="parameter_description"><p>nul-terminated array of objects to build. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for an error, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-add-objects-from-resource.returns"></a><h4>Returns</h4> <p> A positive value on success, 0 if an error occurred</p> </div> <p class="since">Since: <a class="link" href="api-index-3-4.html#api-index-3.4">3.4</a></p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-extend-with-template"></a><h3>gtk_builder_extend_with_template ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_builder_extend_with_template (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> template_type</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> <p>Main private entry point for building composite container components from template XML.</p> <p>This is exported purely to let gtk-builder-tool validate templates, applications have no need to call this function.</p> <div class="refsect3"> <a name="gtk-builder-extend-with-template.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>widget</p></td> <td class="parameter_description"><p>the widget that is being extended</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>template_type</p></td> <td class="parameter_description"><p>the type that the template is for</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>buffer</p></td> <td class="parameter_description"><p>the string to parse</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>length</p></td> <td class="parameter_description"><p>the length of <em class="parameter"><code>buffer</code></em> (may be -1 if <em class="parameter"><code>buffer</code></em> is nul-terminated)</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for an error, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-extend-with-template.returns"></a><h4>Returns</h4> <p> A positive value on success, 0 if an error occurred</p> </div> </div> <hr> <div class="refsect2"> <a name="gtk-builder-get-object"></a><h3>gtk_builder_get_object ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct"><span class="returnvalue">GObject</span></a> * gtk_builder_get_object (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);</pre> <p>Gets the object named <em class="parameter"><code>name</code></em> . Note that this function does not increment the reference count of the returned object.</p> <div class="refsect3"> <a name="gtk-builder-get-object.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>name</p></td> <td class="parameter_description"><p>name of object to get</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-get-object.returns"></a><h4>Returns</h4> <p>the object named <em class="parameter"><code>name</code></em> or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if it could not be found in the object tree. </p> <p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> <p class="since">Since: 2.12</p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-get-objects"></a><h3>gtk_builder_get_objects ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * gtk_builder_get_objects (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>);</pre> <p>Gets all objects that have been constructed by <em class="parameter"><code>builder</code></em> . Note that this function does not increment the reference counts of the returned objects.</p> <div class="refsect3"> <a name="gtk-builder-get-objects.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-get-objects.returns"></a><h4>Returns</h4> <p>a newly-allocated <a href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> containing all the objects constructed by the <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> instance. It should be freed by <a href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#g-slist-free"><code class="function">g_slist_free()</code></a>. </p> <p><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GObject][<acronym title="Free data container after the code is done."><span class="acronym">transfer container</span></acronym>]</span></p> </div> <p class="since">Since: 2.12</p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-expose-object"></a><h3>gtk_builder_expose_object ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> gtk_builder_expose_object (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> *object</code></em>);</pre> <p>Add <em class="parameter"><code>object</code></em> to the <em class="parameter"><code>builder</code></em> object pool so it can be referenced just like any other object built by builder.</p> <div class="refsect3"> <a name="gtk-builder-expose-object.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>name</p></td> <td class="parameter_description"><p>the name of the object exposed to the builder</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object</p></td> <td class="parameter_description"><p>the object to expose</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-3-8.html#api-index-3.8">3.8</a></p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-connect-signals"></a><h3>gtk_builder_connect_signals ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> gtk_builder_connect_signals (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre> <p>This method is a simpler variation of <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals-full" title="gtk_builder_connect_signals_full ()"><code class="function">gtk_builder_connect_signals_full()</code></a>. It uses symbols explicitly added to <em class="parameter"><code>builder</code></em> with prior calls to <a class="link" href="GtkBuilder.html#gtk-builder-add-callback-symbol" title="gtk_builder_add_callback_symbol ()"><code class="function">gtk_builder_add_callback_symbol()</code></a>. In the case that symbols are not explicitly added; it uses <a href="/usr/share/gtk-doc/html/glib/glib-Dynamic-Loading-of-Modules.html#GModule"><span class="type">GModule</span></a>’s introspective features (by opening the module <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>) to look at the application’s symbol table. From here it tries to match the signal handler names given in the interface description with symbols in the application and connects the signals. Note that this function can only be called once, subsequent calls will do nothing.</p> <p>Note that unless <a class="link" href="GtkBuilder.html#gtk-builder-add-callback-symbol" title="gtk_builder_add_callback_symbol ()"><code class="function">gtk_builder_add_callback_symbol()</code></a> is called for all signal callbacks which are referenced by the loaded XML, this function will require that <a href="/usr/share/gtk-doc/html/glib/glib-Dynamic-Loading-of-Modules.html#GModule"><span class="type">GModule</span></a> be supported on the platform.</p> <p>If you rely on <a href="/usr/share/gtk-doc/html/glib/glib-Dynamic-Loading-of-Modules.html#GModule"><span class="type">GModule</span></a> support to lookup callbacks in the symbol table, the following details should be noted:</p> <p>When compiling applications for Windows, you must declare signal callbacks with <a href="/usr/share/gtk-doc/html/glib/glib-Dynamic-Loading-of-Modules.html#G-MODULE-EXPORT:CAPS"><span class="type">G_MODULE_EXPORT</span></a>, or they will not be put in the symbol table. On Linux and Unices, this is not necessary; applications should instead be compiled with the -Wl,--export-dynamic CFLAGS, and linked against gmodule-export-2.0.</p> <div class="refsect3"> <a name="gtk-builder-connect-signals.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>user data to pass back with all signals</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: 2.12</p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-connect-signals-full"></a><h3>gtk_builder_connect_signals_full ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> gtk_builder_connect_signals_full (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code><a class="link" href="GtkBuilder.html#GtkBuilderConnectFunc" title="GtkBuilderConnectFunc ()"><span class="type">GtkBuilderConnectFunc</span></a> func</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre> <p>This function can be thought of the interpreted language binding version of <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals" title="gtk_builder_connect_signals ()"><code class="function">gtk_builder_connect_signals()</code></a>, except that it does not require GModule to function correctly.</p> <div class="refsect3"> <a name="gtk-builder-connect-signals-full.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>func</p></td> <td class="parameter_description"><p>the function used to connect the signals. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid only during the call to the method."><span class="acronym">scope call</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>arbitrary data that will be passed to the connection function</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: 2.12</p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-set-translation-domain"></a><h3>gtk_builder_set_translation_domain ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> gtk_builder_set_translation_domain (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *domain</code></em>);</pre> <p>Sets the translation domain of <em class="parameter"><code>builder</code></em> . See <a class="link" href="GtkBuilder.html#GtkBuilder--translation-domain" title="The “translation-domain” property"><span class="type">“translation-domain”</span></a>.</p> <div class="refsect3"> <a name="gtk-builder-set-translation-domain.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>domain</p></td> <td class="parameter_description"><p>the translation domain or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <p class="since">Since: 2.12</p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-get-translation-domain"></a><h3>gtk_builder_get_translation_domain ()</h3> <pre class="programlisting">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gtk_builder_get_translation_domain (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>);</pre> <p>Gets the translation domain of <em class="parameter"><code>builder</code></em> .</p> <div class="refsect3"> <a name="gtk-builder-get-translation-domain.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-get-translation-domain.returns"></a><h4>Returns</h4> <p> the translation domain. This string is owned by the builder object and must not be modified or freed.</p> </div> <p class="since">Since: 2.12</p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-set-application"></a><h3>gtk_builder_set_application ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> gtk_builder_set_application (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code><a class="link" href="GtkApplication.html" title="GtkApplication"><span class="type">GtkApplication</span></a> *application</code></em>);</pre> <p>Sets the application associated with <em class="parameter"><code>builder</code></em> .</p> <p>You only need this function if there is more than one <a href="/usr/share/gtk-doc/html/gio/GApplication.html#GApplication-struct"><span class="type">GApplication</span></a> in your process. <em class="parameter"><code>application</code></em> cannot be <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p> <div class="refsect3"> <a name="gtk-builder-set-application.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>application</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkApplication.html" title="GtkApplication"><span class="type">GtkApplication</span></a></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-3-10.html#api-index-3.10">3.10</a></p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-get-application"></a><h3>gtk_builder_get_application ()</h3> <pre class="programlisting"><a class="link" href="GtkApplication.html" title="GtkApplication"><span class="returnvalue">GtkApplication</span></a> * gtk_builder_get_application (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>);</pre> <p>Gets the <a class="link" href="GtkApplication.html" title="GtkApplication"><span class="type">GtkApplication</span></a> associated with the builder.</p> <p>The <a class="link" href="GtkApplication.html" title="GtkApplication"><span class="type">GtkApplication</span></a> is used for creating action proxies as requested from XML that the builder is loading.</p> <p>By default, the builder uses the default application: the one from <a href="/usr/share/gtk-doc/html/gio/GApplication.html#g-application-get-default"><code class="function">g_application_get_default()</code></a>. If you want to use another application for constructing proxies, use <a class="link" href="GtkBuilder.html#gtk-builder-set-application" title="gtk_builder_set_application ()"><code class="function">gtk_builder_set_application()</code></a>.</p> <div class="refsect3"> <a name="gtk-builder-get-application.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-get-application.returns"></a><h4>Returns</h4> <p>the application being used by the builder, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p> <p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-3-10.html#api-index-3.10">3.10</a></p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-get-type-from-name"></a><h3>gtk_builder_get_type_from_name ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a> gtk_builder_get_type_from_name (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code>const <span class="type">char</span> *type_name</code></em>);</pre> <p>Looks up a type by name, using the virtual function that <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> has for that purpose. This is mainly used when implementing the <a class="link" href="GtkBuildable.html" title="GtkBuildable"><span class="type">GtkBuildable</span></a> interface on a type.</p> <div class="refsect3"> <a name="gtk-builder-get-type-from-name.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>type_name</p></td> <td class="parameter_description"><p>type name to lookup</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-get-type-from-name.returns"></a><h4>Returns</h4> <p> the <a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> found for <em class="parameter"><code>type_name</code></em> or <a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#G-TYPE-INVALID:CAPS"><span class="type">G_TYPE_INVALID</span></a> if no type was found</p> </div> <p class="since">Since: 2.12</p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-value-from-string"></a><h3>gtk_builder_value_from_string ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_builder_value_from_string (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> *pspec</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue-struct"><span class="type">GValue</span></a> *value</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> <p>This function demarshals a value from a string. This function calls <a href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#g-value-init"><code class="function">g_value_init()</code></a> on the <em class="parameter"><code>value</code></em> argument, so it need not be initialised beforehand.</p> <p>This function can handle char, uchar, boolean, int, uint, long, ulong, enum, flags, float, double, string, <a href="../html/gdk3-Colors.html#GdkColor"><span class="type">GdkColor</span></a>, <a href="../html/gdk3-RGBA-Colors.html#GdkRGBA"><span class="type">GdkRGBA</span></a> and <a class="link" href="GtkAdjustment.html" title="GtkAdjustment"><span class="type">GtkAdjustment</span></a> type values. Support for <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> type values is still to come.</p> <p>Upon errors <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> will be returned and <em class="parameter"><code>error</code></em> will be assigned a <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a> domain.</p> <div class="refsect3"> <a name="gtk-builder-value-from-string.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>pspec</p></td> <td class="parameter_description"><p>the <a href="/usr/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> for the property</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>string</p></td> <td class="parameter_description"><p>the string representation of the value</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>the <a href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue-struct"><span class="type">GValue</span></a> to store the result in. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for an error, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-value-from-string.returns"></a><h4>Returns</h4> <p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> </div> <p class="since">Since: 2.12</p> </div> <hr> <div class="refsect2"> <a name="gtk-builder-value-from-string-type"></a><h3>gtk_builder_value_from_string_type ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_builder_value_from_string_type (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> type</code></em>, <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue-struct"><span class="type">GValue</span></a> *value</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> <p>Like <a class="link" href="GtkBuilder.html#gtk-builder-value-from-string" title="gtk_builder_value_from_string ()"><code class="function">gtk_builder_value_from_string()</code></a>, this function demarshals a value from a string, but takes a <a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> instead of <a href="/usr/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a>. This function calls <a href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#g-value-init"><code class="function">g_value_init()</code></a> on the <em class="parameter"><code>value</code></em> argument, so it need not be initialised beforehand.</p> <p>Upon errors <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> will be returned and <em class="parameter"><code>error</code></em> will be assigned a <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a> domain.</p> <div class="refsect3"> <a name="gtk-builder-value-from-string-type.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>builder</p></td> <td class="parameter_description"><p>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>type</p></td> <td class="parameter_description"><p>the <a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> of the value</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>string</p></td> <td class="parameter_description"><p>the string representation of the value</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>the <a href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue-struct"><span class="type">GValue</span></a> to store the result in. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for an error, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gtk-builder-value-from-string-type.returns"></a><h4>Returns</h4> <p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> </div> <p class="since">Since: 2.12</p> </div> <hr> <div class="refsect2"> <a name="GTK-BUILDER-WARN-INVALID-CHILD-TYPE:CAPS"></a><h3>GTK_BUILDER_WARN_INVALID_CHILD_TYPE()</h3> <pre class="programlisting">#define GTK_BUILDER_WARN_INVALID_CHILD_TYPE(object, type)</pre> <p>This macro should be used to emit a warning about and unexpected <em class="parameter"><code>type</code></em> value in a <a class="link" href="GtkBuildable.html" title="GtkBuildable"><span class="type">GtkBuildable</span></a> add_child implementation.</p> <div class="refsect3"> <a name="GTK-BUILDER-WARN-INVALID-CHILD-TYPE.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>object</p></td> <td class="parameter_description"><p>the <a class="link" href="GtkBuildable.html" title="GtkBuildable"><span class="type">GtkBuildable</span></a> on which the warning ocurred</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>type</p></td> <td class="parameter_description"><p>the unexpected type value</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> </div> <div class="refsect1"> <a name="GtkBuilder.other_details"></a><h2>Types and Values</h2> <div class="refsect2"> <a name="GtkBuilder-struct"></a><h3>GtkBuilder</h3> <pre class="programlisting">typedef struct _GtkBuilder GtkBuilder;</pre> </div> <hr> <div class="refsect2"> <a name="GtkBuilderError"></a><h3>enum GtkBuilderError</h3> <p>Error codes that identify various errors that can occur while using <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>.</p> <div class="refsect3"> <a name="GtkBuilderError.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="GTK-BUILDER-ERROR-INVALID-TYPE-FUNCTION:CAPS"></a>GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION</p></td> <td class="enum_member_description"> <p>A type-func attribute didn’t name a function that returns a <a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a>.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="GTK-BUILDER-ERROR-UNHANDLED-TAG:CAPS"></a>GTK_BUILDER_ERROR_UNHANDLED_TAG</p></td> <td class="enum_member_description"> <p>The input contained a tag that <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> can’t handle.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="GTK-BUILDER-ERROR-MISSING-ATTRIBUTE:CAPS"></a>GTK_BUILDER_ERROR_MISSING_ATTRIBUTE</p></td> <td class="enum_member_description"> <p>An attribute that is required by <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> was missing.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="GTK-BUILDER-ERROR-INVALID-ATTRIBUTE:CAPS"></a>GTK_BUILDER_ERROR_INVALID_ATTRIBUTE</p></td> <td class="enum_member_description"> <p><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> found an attribute that it doesn’t understand.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="GTK-BUILDER-ERROR-INVALID-TAG:CAPS"></a>GTK_BUILDER_ERROR_INVALID_TAG</p></td> <td class="enum_member_description"> <p><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> found a tag that it doesn’t understand.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="GTK-BUILDER-ERROR-MISSING-PROPERTY-VALUE:CAPS"></a>GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE</p></td> <td class="enum_member_description"> <p>A required property value was missing.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="GTK-BUILDER-ERROR-INVALID-VALUE:CAPS"></a>GTK_BUILDER_ERROR_INVALID_VALUE</p></td> <td class="enum_member_description"> <p><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> couldn’t parse some attribute value.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="GTK-BUILDER-ERROR-VERSION-MISMATCH:CAPS"></a>GTK_BUILDER_ERROR_VERSION_MISMATCH</p></td> <td class="enum_member_description"> <p>The input file requires a newer version of GTK+.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="GTK-BUILDER-ERROR-DUPLICATE-ID:CAPS"></a>GTK_BUILDER_ERROR_DUPLICATE_ID</p></td> <td class="enum_member_description"> <p>An object id occurred twice.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="GTK-BUILDER-ERROR-OBJECT-TYPE-REFUSED:CAPS"></a>GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED</p></td> <td class="enum_member_description"> <p>A specified object type is of the same type or derived from the type of the composite class being extended with builder XML.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="GTK-BUILDER-ERROR-TEMPLATE-MISMATCH:CAPS"></a>GTK_BUILDER_ERROR_TEMPLATE_MISMATCH</p></td> <td class="enum_member_description"> <p>The wrong type was specified in a composite class’s template XML</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="GTK-BUILDER-ERROR-INVALID-PROPERTY:CAPS"></a>GTK_BUILDER_ERROR_INVALID_PROPERTY</p></td> <td class="enum_member_description"> <p>The specified property is unknown for the object class.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="GTK-BUILDER-ERROR-INVALID-SIGNAL:CAPS"></a>GTK_BUILDER_ERROR_INVALID_SIGNAL</p></td> <td class="enum_member_description"> <p>The specified signal is unknown for the object class.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="GTK-BUILDER-ERROR-INVALID-ID:CAPS"></a>GTK_BUILDER_ERROR_INVALID_ID</p></td> <td class="enum_member_description"> <p>An object id is unknown</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="GTK-BUILDER-ERROR:CAPS"></a><h3>GTK_BUILDER_ERROR</h3> <pre class="programlisting">#define GTK_BUILDER_ERROR (gtk_builder_error_quark ()) </pre> </div> </div> <div class="refsect1"> <a name="GtkBuilder.property-details"></a><h2>Property Details</h2> <div class="refsect2"> <a name="GtkBuilder--translation-domain"></a><h3>The <code class="literal">“translation-domain”</code> property</h3> <pre class="programlisting"> “translation-domain” <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</pre> <p>The translation domain used when translating property values that have been marked as translatable in interface descriptions. If the translation domain is <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> uses <code class="function">gettext()</code>, otherwise <a href="/usr/share/gtk-doc/html/glib/glib-I18N.html#g-dgettext"><code class="function">g_dgettext()</code></a>.</p> <p>Owner: GtkBuilder</p> <p>Flags: Read / Write</p> <p>Default value: NULL</p> <p class="since">Since: 2.12</p> </div> </div> </div> <div class="footer"> <hr>Generated by GTK-Doc V1.32</div> </body> </html>