8
8
<link rel="up" href="property-bags.html" title="Property Bags, Events, Listeners">
9
9
<link rel="prev" href="property-bags.html" title="Property Bags, Events, Listeners">
10
10
<link rel="next" href="libbonobo-bonobo-event-source.html" title="bonobo-event-source">
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
11
<meta name="generator" content="GTK-Doc V1.14 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="chapter" href="general.html" title="General">
14
14
<link rel="chapter" href="factories.html" title="Objects, Factories, Reference Counting">
30
30
<div class="refentry" title="Properties">
31
31
<a name="properties"></a><div class="titlepage"></div>
32
32
<div class="refsect1" title="Properties">
33
<a name="id2979020"></a><h2>Properties</h2>
33
<a name="id2619131"></a><h2>Properties</h2>
34
34
<p>Bonobo component properties, version 0.1 by Michael
35
35
Meeks <mmeeks@gnu.org></p>
36
36
<p>A brief discussion of how to use the property API to add
37
37
a simple to use configuration mechanism to your bonobo
39
39
<div class="refsect2" title="Properties and bags">
40
<a name="id2979037"></a><h3>Properties and bags</h3>
40
<a name="id2619150"></a><h3>Properties and bags</h3>
41
41
<p>A property is an attribute that is attached to a
42
42
Bonobo object. It can have any type, although the
43
43
standard types <span class="type">boolean</span>,
51
51
<div class="refsect2" title="BonoboArgs">
52
<a name="id2979102"></a><h3>BonoboArgs</h3>
52
<a name="id2619219"></a><h3>BonoboArgs</h3>
53
53
<p>A bonobo arg contains the value of a property whilst
54
54
it is 'in flight' between a property and a
55
55
requestor. The bonobo arg system is designed to make
78
78
<div class="refsect2" title="PropertyBag creation">
79
<a name="id2979193"></a><h3>PropertyBag creation</h3>
79
<a name="id2620409"></a><h3>PropertyBag creation</h3>
80
80
<p>To add properties to an object first we must create
81
81
a property bag hence:</p>
82
82
<pre class="synopsis">
101
101
<div class="refsect2" title="Property Creation">
102
<a name="id2980285"></a><h3>Property Creation</h3>
102
<a name="id2620447"></a><h3>Property Creation</h3>
103
103
<p> Each basic property is created by this function: </p>
104
104
<pre class="synopsis">
105
105
void bonobo_property_bag_add (BonoboPropertyBag *pb,
134
134
<div class="refsect2" title="Wrapping GObjects">
135
<a name="id2980342"></a><h3>Wrapping GObjects</h3>
135
<a name="id2620508"></a><h3>Wrapping GObjects</h3>
136
136
<p> If you have already implemented a GObject that
137
137
has the set of properties that you wish to export as
138
138
Bonobo properties then it is trivial to add them to
155
155
<div class="refsect2" title="Using properties in your client application">
156
<a name="id2980365"></a><h3>Using properties in your client application</h3>
156
<a name="id2620533"></a><h3>Using properties in your client application</h3>
157
157
<p>There are some fairly typesafe but convenient vararg
158
158
ways to get remote properties. Example:</p>
159
<div class="informalexample"><pre class="programlisting">
162
bonobo_widget_get_property (control, "value",
163
TC_CORBA_double, &i, NULL);
165
bonobo_widget_set_property (control, "value",
166
TC_CORBA_double, i, NULL);
159
<div class="informalexample">
160
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
163
<td class="listing_lines" align="right"><pre>1
170
<td class="listing_code"><pre class="programlisting">CORBA_double i;
172
bonobo_widget_get_property (control, <span class="number">"value"</span>,
173
TC_CORBA_double, &i, <span class="number">NULL</span>);
174
i+= <span class="number">0.37</span>;
175
bonobo_widget_set_property (control, <span class="number">"value"</span>,
176
TC_CORBA_double, i, <span class="number">NULL</span>);</pre></td>
168
182
<p>The alternative being the even more type safe version:</p>
169
183
<pre class="programlisting">
170
184
bonobo_property_bag_client_get_value_gdouble (pb, "value", &i);