1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Libglade Build</title><meta name="generator" content="DocBook XSL Stylesheets V1.66.1"><link rel="start" href="index.html" title="Libglade Reference Manual"><link rel="up" href="libglade-lib.html" title="PartI.Libglade Library Reference"><link rel="prev" href="libglade-Libglade-SAX-Parser.html" title="Libglade SAX Parser"><meta name="generator" content="GTK-Doc V1.3 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="chapter" href="libglade-notes.html" title="Libglade Programming Notes"><link rel="chapter" href="libglade-dtd.html" title="Glade 2.0 File Format"><link rel="part" href="libglade-lib.html" title="PartI.Libglade Library Reference"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libglade-Libglade-SAX-Parser.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="libglade-lib.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">Libglade Reference Manual</th></tr></table><div class="refentry" lang="en"><a name="libglade-Libglade-Build"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><span class="refentrytitle">Libglade Build</span></h2><p>Libglade Build — Routines used by widget building routines</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
#include <glade/glade.h>
#include <glade/glade-build.h>
GtkWidget* (<a href="libglade-Libglade-Build.html#GladeNewFunc">*GladeNewFunc</a>) (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml,
GType widget_type,
<a href="libglade-Libglade-SAX-Parser.html#GladeWidgetInfo">GladeWidgetInfo</a> *info);
void (<a href="libglade-Libglade-Build.html#GladeBuildChildrenFunc">*GladeBuildChildrenFunc</a>) (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml,
GtkWidget *parent,
<a href="libglade-Libglade-SAX-Parser.html#GladeWidgetInfo">GladeWidgetInfo</a> *info);
GtkWidget* (<a href="libglade-Libglade-Build.html#GladeFindInternalChildFunc">*GladeFindInternalChildFunc</a>) (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml,
GtkWidget *parent,
const gchar *childname);
GtkWidget* <a href="libglade-Libglade-Build.html#glade-xml-build-widget">glade_xml_build_widget</a> (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *self,
<a href="libglade-Libglade-SAX-Parser.html#GladeWidgetInfo">GladeWidgetInfo</a> *info);
void <a href="libglade-Libglade-Build.html#glade-xml-handle-internal-child">glade_xml_handle_internal_child</a> (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *self,
GtkWidget *parent,
<a href="libglade-Libglade-SAX-Parser.html#GladeChildInfo">GladeChildInfo</a> *child_info);
void <a href="libglade-Libglade-Build.html#glade-xml-set-common-params">glade_xml_set_common_params</a> (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *self,
GtkWidget *widget,
<a href="libglade-Libglade-SAX-Parser.html#GladeWidgetInfo">GladeWidgetInfo</a> *info);
void <a href="libglade-Libglade-Build.html#glade-register-widget">glade_register_widget</a> (GType type,
<a href="libglade-Libglade-Build.html#GladeNewFunc">GladeNewFunc</a> new_func,
<a href="libglade-Libglade-Build.html#GladeBuildChildrenFunc">GladeBuildChildrenFunc</a> build_children,
<a href="libglade-Libglade-Build.html#GladeFindInternalChildFunc">GladeFindInternalChildFunc</a> find_internal_child);
GtkWidget* <a href="libglade-Libglade-Build.html#glade-standard-build-widget">glade_standard_build_widget</a> (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml,
GType widget_type,
<a href="libglade-Libglade-SAX-Parser.html#GladeWidgetInfo">GladeWidgetInfo</a> *info);
void <a href="libglade-Libglade-Build.html#glade-xml-handle-widget-prop">glade_xml_handle_widget_prop</a> (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *self,
GtkWidget *widget,
const gchar *prop_name,
const gchar *value_name);
void <a href="libglade-Libglade-Build.html#glade-standard-build-children">glade_standard_build_children</a> (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *self,
GtkWidget *parent,
<a href="libglade-Libglade-SAX-Parser.html#GladeWidgetInfo">GladeWidgetInfo</a> *info);
void <a href="libglade-Libglade-Build.html#glade-xml-set-packing-property">glade_xml_set_packing_property</a> (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *self,
GtkWidget *parent,
GtkWidget *child,
const char *name,
const char *value);
void (<a href="libglade-Libglade-Build.html#GladeApplyCustomPropFunc">*GladeApplyCustomPropFunc</a>) (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml,
GtkWidget *widget,
const gchar *propname,
const gchar *value);
void <a href="libglade-Libglade-Build.html#glade-register-custom-prop">glade_register_custom_prop</a> (GType type,
const gchar *prop_name,
<a href="libglade-Libglade-Build.html#GladeApplyCustomPropFunc">GladeApplyCustomPropFunc</a> apply_prop);
gchar* <a href="libglade-Libglade-Build.html#glade-xml-relative-file">glade_xml_relative_file</a> (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *self,
const gchar *filename);
gint <a href="libglade-Libglade-Build.html#glade-enum-from-string">glade_enum_from_string</a> (GType type,
const char *string);
guint <a href="libglade-Libglade-Build.html#glade-flags-from-string">glade_flags_from_string</a> (GType type,
const char *string);
gboolean <a href="libglade-Libglade-Build.html#glade-xml-set-value-from-string">glade_xml_set_value_from_string</a> (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml,
GParamSpec *pspec,
const gchar *string,
GValue *value);
void <a href="libglade-Libglade-Build.html#glade-xml-set-toplevel">glade_xml_set_toplevel</a> (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml,
GtkWindow *window);
GtkAccelGroup* <a href="libglade-Libglade-Build.html#glade-xml-ensure-accel">glade_xml_ensure_accel</a> (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml);
#define <a href="libglade-Libglade-Build.html#GLADE-MODULE-CHECK-INIT:CAPS">GLADE_MODULE_CHECK_INIT</a>
</pre></div><div class="refsect1" lang="en"><a name="id314425"></a><h2>Description</h2><p>
These functions are used by the routines that are responsible for building
the actual widgets from the XML node data structures.
</p></div><div class="refsect1" lang="en"><a name="id314436"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id314441"></a><h3><a name="GladeNewFunc"></a>GladeNewFunc ()</h3><a class="indexterm" name="id314449"></a><pre class="programlisting">GtkWidget* (*GladeNewFunc) (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml,
GType widget_type,
<a href="libglade-Libglade-SAX-Parser.html#GladeWidgetInfo">GladeWidgetInfo</a> *info);</pre><p>
This function signature should be used by functions that build particular
widget types. The function should create the new widget and set any non
standard widget parameters (ie. don't set visibility, size, etc), as
this is handled by glade_xml_build_widget, which calls these functions.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>xml</tt></i>:</span></td><td> The GladeXML object.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>widget_type</tt></i>:</span></td><td> the GType code of the widget.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>info</tt></i>:</span></td><td> the GladeWidgetInfo structure for this widget.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td> the new widget.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id341178"></a><h3><a name="GladeBuildChildrenFunc"></a>GladeBuildChildrenFunc ()</h3><a class="indexterm" name="id341186"></a><pre class="programlisting">void (*GladeBuildChildrenFunc) (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml,
GtkWidget *parent,
<a href="libglade-Libglade-SAX-Parser.html#GladeWidgetInfo">GladeWidgetInfo</a> *info);</pre><p>
This function signature should be used by functions that are responsible
for adding children to a container widget. To create each child widget,
glade_xml_build_widget should be called.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>xml</tt></i>:</span></td><td> the GladeXML object.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>parent</tt></i>:</span></td><td> the parent.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>info</tt></i>:</span></td><td> the GladeWidgetInfo structure for the parent.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id341256"></a><h3><a name="GladeFindInternalChildFunc"></a>GladeFindInternalChildFunc ()</h3><a class="indexterm" name="id341265"></a><pre class="programlisting">GtkWidget* (*GladeFindInternalChildFunc) (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml,
GtkWidget *parent,
const gchar *childname);</pre><p>
When some composite widgets are created, a number of children are
added at the same time (for example, the vbox in a GtkDialog).
These widgets are identified in the XML interface file by the
internal-child attribute on their &lt;child&gt; element.
</p><p>
When libglade encounters an internal child, rather than creating a
new widget instance, libglade walks up the tree until it finds the
first non internal-child parent. It then calls the
find_internal_child callback for that parent's class.
</p><p>
That callback should return the internal child corresponding to the
name passed in as the third argument.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>xml</tt></i>:</span></td><td> the GladeXML object.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>parent</tt></i>:</span></td><td> the parent widget.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>childname</tt></i>:</span></td><td> the name of the internal child
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td> the named internal child.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id341355"></a><h3><a name="glade-xml-build-widget"></a>glade_xml_build_widget ()</h3><a class="indexterm" name="id341363"></a><pre class="programlisting">GtkWidget* glade_xml_build_widget (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *self,
<a href="libglade-Libglade-SAX-Parser.html#GladeWidgetInfo">GladeWidgetInfo</a> *info);</pre><p>
This function is not intended for people who just use libglade. Instead
it is for people extending it (it is designed to be called in the child
build routine defined for the parent widget). It first checks the type
of the widget from the class tag, then calls the corresponding widget
creation routine. This routine sets up all the settings specific to that
type of widget. Then general widget settings are performed on the widget.
Then it sets up accelerators for the widget, and extracts any signal
information for the widget. Then it checks to see if there are any
child widget nodes for this widget, and if so calls the widget's
build routine, which will create the children with this function and add
them to the widget in the appropriate way. Finally it returns the widget.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>self</tt></i>:</span></td><td> the GladeXML object.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>info</tt></i>:</span></td><td> the GladeWidgetInfo structure for the widget.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td> the newly created widget.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id333782"></a><h3><a name="glade-xml-handle-internal-child"></a>glade_xml_handle_internal_child ()</h3><a class="indexterm" name="id309442"></a><pre class="programlisting">void glade_xml_handle_internal_child (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *self,
GtkWidget *parent,
<a href="libglade-Libglade-SAX-Parser.html#GladeChildInfo">GladeChildInfo</a> *child_info);</pre><p>
This function is intended to be called by the build_children
callback for container widgets. If the build_children callback
encounters a child with the internal-child attribute set, then it
should call this function to handle it and then continue on to the
next child.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>self</tt></i>:</span></td><td> the GladeXML object.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>parent</tt></i>:</span></td><td> the parent widget.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>child_info</tt></i>:</span></td><td> the GladeChildInfo structure for the child.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id341453"></a><h3><a name="glade-xml-set-common-params"></a>glade_xml_set_common_params ()</h3><a class="indexterm" name="id341461"></a><pre class="programlisting">void glade_xml_set_common_params (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *self,
GtkWidget *widget,
<a href="libglade-Libglade-SAX-Parser.html#GladeWidgetInfo">GladeWidgetInfo</a> *info);</pre><p>
This function sets the common parameters on a widget, and is responsible
for inserting it into the GladeXML object's internal structures. It will
also add the children to this widget. Usually this function is only called
by glade_xml_build_widget, but is exposed for difficult cases, such as
setting up toolbar buttons and the like.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>self</tt></i>:</span></td><td> the GladeXML widget.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>widget</tt></i>:</span></td><td> the widget to set parameters on.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>info</tt></i>:</span></td><td> the GladeWidgetInfo structure for the widget.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id341529"></a><h3><a name="glade-register-widget"></a>glade_register_widget ()</h3><a class="indexterm" name="id341538"></a><pre class="programlisting">void glade_register_widget (GType type,
<a href="libglade-Libglade-Build.html#GladeNewFunc">GladeNewFunc</a> new_func,
<a href="libglade-Libglade-Build.html#GladeBuildChildrenFunc">GladeBuildChildrenFunc</a> build_children,
<a href="libglade-Libglade-Build.html#GladeFindInternalChildFunc">GladeFindInternalChildFunc</a> find_internal_child);</pre><p>
This function is used to register new construction functions for a
widget type. The child building routine would call
<a href="libglade-Libglade-Build.html#glade-xml-build-widget"><tt class="function">glade_xml_build_widget()</tt></a> on each child node to create the child
before packing it.
</p><p>
This function is mainly useful for addon widget modules for libglade
(it would get called from the <tt class="function">glade_init_module()</tt> function).</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>type</tt></i>:</span></td><td> the GType of the widget.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>new_func</tt></i>:</span></td><td> the function used to construct instances of the widget.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>build_children</tt></i>:</span></td><td> function used to construct children (or NULL).
</td></tr><tr><td><span class="term"><i class="parameter"><tt>find_internal_child</tt></i>:</span></td><td> function to find internal children (or NULL).
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id341640"></a><h3><a name="glade-standard-build-widget"></a>glade_standard_build_widget ()</h3><a class="indexterm" name="id341649"></a><pre class="programlisting">GtkWidget* glade_standard_build_widget (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml,
GType widget_type,
<a href="libglade-Libglade-SAX-Parser.html#GladeWidgetInfo">GladeWidgetInfo</a> *info);</pre><p>
This is the standard widget building function. It processes all
the widget properties using the standard object properties
interfaces. This function will be sufficient for most widget
types, thus reducing the ammount of work needed to wrap a library.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>xml</tt></i>:</span></td><td> the GladeXML object.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>widget_type</tt></i>:</span></td><td> the GType of the widget.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>info</tt></i>:</span></td><td> the GladeWidgetInfo structure.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td> the constructed widget.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id341729"></a><h3><a name="glade-xml-handle-widget-prop"></a>glade_xml_handle_widget_prop ()</h3><a class="indexterm" name="id341738"></a><pre class="programlisting">void glade_xml_handle_widget_prop (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *self,
GtkWidget *widget,
const gchar *prop_name,
const gchar *value_name);</pre><p>
Some widgets have properties of type GtkWidget. These are
represented as the widget name in the glade file. When
constructing the interface, the widget specified as the value for a
property may not exist yet.
</p><p>
Rather than setting the property directly, this function should be
used. It will perform the name to GtkWidget conversion, and if the
widget is yet to be constructed, defer setting the property until
the widget is constructed.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>self</tt></i>:</span></td><td> the GladeXML object
</td></tr><tr><td><span class="term"><i class="parameter"><tt>widget</tt></i>:</span></td><td> the property the widget to set the property on.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>prop_name</tt></i>:</span></td><td> the name of the property.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>value_name</tt></i>:</span></td><td> the name of the widget used as the value for the property.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id341829"></a><h3><a name="glade-standard-build-children"></a>glade_standard_build_children ()</h3><a class="indexterm" name="id341838"></a><pre class="programlisting">void glade_standard_build_children (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *self,
GtkWidget *parent,
<a href="libglade-Libglade-SAX-Parser.html#GladeWidgetInfo">GladeWidgetInfo</a> *info);</pre><p>
This is the standard child building function. It simply calls
gtk_container_add on each child to add them to the parent, and
process any packing properties using the generic container packing
properties interfaces.
</p><p>
This function will be sufficient for most container widgets
provided that they implement the GtkContainer child packing
properties interfaces.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>self</tt></i>:</span></td><td> the GladeXML object.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>parent</tt></i>:</span></td><td> the container widget.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>info</tt></i>:</span></td><td> the GladeWidgetInfo structure.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id341913"></a><h3><a name="glade-xml-set-packing-property"></a>glade_xml_set_packing_property ()</h3><a class="indexterm" name="id341921"></a><pre class="programlisting">void glade_xml_set_packing_property (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *self,
GtkWidget *parent,
GtkWidget *child,
const char *name,
const char *value);</pre><p>
This sets the packing property on container <i class="parameter"><tt>parent</tt></i> of widget
<i class="parameter"><tt>child</tt></i> with <i class="parameter"><tt>name</tt></i> to <i class="parameter"><tt>value</tt></i></p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>self</tt></i>:</span></td><td> the GladeXML object.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>parent</tt></i>:</span></td><td> the container widget.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>child</tt></i>:</span></td><td> the contained child
</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i>:</span></td><td> the name of the property
</td></tr><tr><td><span class="term"><i class="parameter"><tt>value</tt></i>:</span></td><td> it's stringified value
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id342033"></a><h3><a name="GladeApplyCustomPropFunc"></a>GladeApplyCustomPropFunc ()</h3><a class="indexterm" name="id342042"></a><pre class="programlisting">void (*GladeApplyCustomPropFunc) (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml,
GtkWidget *widget,
const gchar *propname,
const gchar *value);</pre><p>
This prototype is used for custom property handlers registered with
<a href="libglade-Libglade-Build.html#glade-register-custom-prop"><tt class="function">glade_register_custom_prop()</tt></a>.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>xml</tt></i>:</span></td><td> the GladeXML object.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>widget</tt></i>:</span></td><td> the widget to apply the property to.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>propname</tt></i>:</span></td><td> the name of the property.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>value</tt></i>:</span></td><td> the value of the property.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id342132"></a><h3><a name="glade-register-custom-prop"></a>glade_register_custom_prop ()</h3><a class="indexterm" name="id342141"></a><pre class="programlisting">void glade_register_custom_prop (GType type,
const gchar *prop_name,
<a href="libglade-Libglade-Build.html#GladeApplyCustomPropFunc">GladeApplyCustomPropFunc</a> apply_prop);</pre><p>
Some properties are not (yet) handled through the GObject property
code, so can not be handled by the generic code. This function
provides a way to register handlers for these properties. Such
handlers will apply for the GType <i class="parameter"><tt>type</tt></i> and all its descendants.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>type</tt></i>:</span></td><td> the GType of the widget.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>prop_name</tt></i>:</span></td><td> the name for the custom widget.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>apply_prop</tt></i>:</span></td><td> the function to be called when the custom property is found.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id342215"></a><h3><a name="glade-xml-relative-file"></a>glade_xml_relative_file ()</h3><a class="indexterm" name="id342223"></a><pre class="programlisting">gchar* glade_xml_relative_file (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *self,
const gchar *filename);</pre><p>
This function resolves a relative pathname, using the directory of the
XML file as a base. If the pathname is absolute, then the original
filename is returned.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>self</tt></i>:</span></td><td> the GladeXML object.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>filename</tt></i>:</span></td><td> the filename.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td> the filename. The result must be g_free'd.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id342287"></a><h3><a name="glade-enum-from-string"></a>glade_enum_from_string ()</h3><a class="indexterm" name="id342295"></a><pre class="programlisting">gint glade_enum_from_string (GType type,
const char *string);</pre><p>
This helper routine is designed to be used by widget build routines to
convert the string representations of enumeration values found in the
XML descriptions to the integer values that can be used to configure
the widget.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>type</tt></i>:</span></td><td> the GType for this enum type.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>string</tt></i>:</span></td><td> the string representation of the enum value.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td> the integer value for this enumeration, or 0 if it couldn't be
found.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id342360"></a><h3><a name="glade-flags-from-string"></a>glade_flags_from_string ()</h3><a class="indexterm" name="id342368"></a><pre class="programlisting">guint glade_flags_from_string (GType type,
const char *string);</pre><p>
This helper routine is designed to be used by widget build routines
to convert the string representations of flags values found in the
XML descriptions to the integer values that can be used to
configure the widget. The string is composed of string names or
nicknames for various flags separated by '|'.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>type</tt></i>:</span></td><td> the GType for this flags type.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>string</tt></i>:</span></td><td> the string representation of the flags value.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td> the integer value for this flags string
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id342433"></a><h3><a name="glade-xml-set-value-from-string"></a>glade_xml_set_value_from_string ()</h3><a class="indexterm" name="id342442"></a><pre class="programlisting">gboolean glade_xml_set_value_from_string (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml,
GParamSpec *pspec,
const gchar *string,
GValue *value);</pre><p>
This function demarshals a value from a string. This function
calls <tt class="function">g_value_init()</tt> on the <i class="parameter"><tt>value</tt></i> 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, GdkColor and
GtkAdjustment type values. Support for GtkWidget type values is
still to come.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>xml</tt></i>:</span></td><td> the GladeXML object.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>pspec</tt></i>:</span></td><td> the GParamSpec for the property
</td></tr><tr><td><span class="term"><i class="parameter"><tt>string</tt></i>:</span></td><td> the string representation of the value.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>value</tt></i>:</span></td><td> the GValue to store the result in.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td> <tt class="literal">TRUE</tt> on success.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id342554"></a><h3><a name="glade-xml-set-toplevel"></a>glade_xml_set_toplevel ()</h3><a class="indexterm" name="id342562"></a><pre class="programlisting">void glade_xml_set_toplevel (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml,
GtkWindow *window);</pre><p>
This is used while the tree is being built to set the toplevel window that
is currently being built. It is mainly used to enable GtkAccelGroup's to
be bound to the correct window, but could have other uses.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>xml</tt></i>:</span></td><td> the GladeXML object.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>window</tt></i>:</span></td><td> the toplevel.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id342617"></a><h3><a name="glade-xml-ensure-accel"></a>glade_xml_ensure_accel ()</h3><a class="indexterm" name="id342625"></a><pre class="programlisting">GtkAccelGroup* glade_xml_ensure_accel (<a href="GladeXML.html" title="GladeXML">GladeXML</a> *xml);</pre><p>
This function is used to get the current GtkAccelGroup. If there isn't
one, a new one is created and bound to the current toplevel window (if
a toplevel has been set).</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>xml</tt></i>:</span></td><td> the GladeXML object.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td> the current GtkAccelGroup.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id342673"></a><h3><a name="GLADE-MODULE-CHECK-INIT:CAPS"></a>GLADE_MODULE_CHECK_INIT</h3><a class="indexterm" name="id342682"></a><pre class="programlisting">#define GLADE_MODULE_CHECK_INIT</pre><p>
This macro will insert a suitable version check function into a
libglade loadable module.</p><p>
</p></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libglade-Libglade-SAX-Parser.html"><b><<Libglade SAX Parser</b></a></td><td align="right"></td></tr></table></body></html>
|