~ubuntu-branches/ubuntu/precise/gtk+2.0/precise-updates

« back to all changes in this revision

Viewing changes to docs/reference/gtk/tmpl/gtkexpander.sgml

  • Committer: Package Import Robot
  • Author(s): Ken VanDine
  • Date: 2011-12-01 11:40:06 UTC
  • mfrom: (1.14.11)
  • Revision ID: package-import@ubuntu.com-20111201114006-nrmf6qu3pg512veo
Tags: 2.24.8-0ubuntu1
* New upstream release 
  - gtkfilechooser should be more robust to malformed URIs
    in .gtk-bookmarks (LP: #189494)
* debian/patches/010_make_bg_changes_queue_repaint.patch
  - dropped it introduces performance regressions in some gtk2 
    apps (LP: #889019)
* 101_filechooser.patch, 000git_file_chooser.patch: dropped, upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!-- ##### SECTION Title ##### -->
2
 
GtkExpander
3
 
 
4
 
<!-- ##### SECTION Short_Description ##### -->
5
 
A container which can hide its child
6
 
 
7
 
<!-- ##### SECTION Long_Description ##### -->
8
 
<para>
9
 
A #GtkExpander allows the user to hide or show its child by clicking 
10
 
on an expander triangle similar to the triangles used in a #GtkTreeView.
11
 
</para>
12
 
 
13
 
<para>
14
 
Normally you use an expander as you would use any other descendant
15
 
of #GtkBin; you create the child widget and use gtk_container_add() 
16
 
to add it to the expander. When the expander is toggled, it will take 
17
 
care of showing and hiding the child automatically.
18
 
</para>
19
 
 
20
 
<section id="expander-special-usage">
21
 
<title>Special Usage</title>
22
 
 
23
 
<para>
24
 
There are situations in which you may prefer to show and hide the 
25
 
expanded widget yourself, such as when you want to actually create 
26
 
the widget at expansion time. In this case, create a #GtkExpander 
27
 
but do not add a child to it. The expander widget has an 
28
 
<literal>expanded</literal> property which can be used to monitor 
29
 
its expansion state. You should watch this property with a signal 
30
 
connection as follows:
31
 
</para>
32
 
 
33
 
<programlisting id="expander-callback-example">
34
 
expander = gtk_expander_new_with_mnemonic ("_More Options");
35
 
g_signal_connect (expander, "notify::expanded",
36
 
                  G_CALLBACK (expander_callback), NULL);
37
 
 
38
 
...
39
 
 
40
 
static void
41
 
expander_callback (GObject    *object,
42
 
                   GParamSpec *param_spec,
43
 
                   gpointer    user_data)
44
 
{
45
 
  GtkExpander *expander;
46
 
 
47
 
  expander = GTK_EXPANDER (object);
48
 
 
49
 
  if (gtk_expander_get_expanded (expander))
50
 
    {
51
 
      /* Show or create widgets */
52
 
    }
53
 
  else
54
 
    {
55
 
      /* Hide or destroy widgets */
56
 
    }
57
 
}
58
 
</programlisting>
59
 
</section>
60
 
<refsect2 id="GtkExpander-BUILDER-UI">
61
 
<title>GtkExpander as GtkBuildable</title>
62
 
<para>
63
 
The GtkExpander implementation of the GtkBuildable interface 
64
 
supports placing a child in the label position by specifying
65
 
"label" as the "type" attribute of a &lt;child&gt; element.
66
 
A normal content child can be specified without specifying 
67
 
a &lt;child&gt; type attribute.
68
 
</para>
69
 
<example>
70
 
<title>A UI definition fragment with GtkExpander</title>
71
 
<programlisting><![CDATA[
72
 
<object class="GtkExpander">
73
 
  <child type="label">
74
 
    <object class="GtkLabel" id="expander-label"/>
75
 
  </child>
76
 
  <child>
77
 
    <object class="GtkEntry" id="expander-content"/>
78
 
  </child>
79
 
</object>
80
 
]]></programlisting>
81
 
</example>
82
 
</refsect2>
83
 
 
84
 
<!-- ##### SECTION See_Also ##### -->
85
 
<para>
86
 
 
87
 
</para>
88
 
 
89
 
<!-- ##### SECTION Stability_Level ##### -->
90
 
 
91
 
 
92
 
<!-- ##### SECTION Image ##### -->
93
 
 
94
 
 
95
 
<!-- ##### STRUCT GtkExpander ##### -->
96
 
<para>
97
 
 
98
 
</para>
99
 
 
100
 
 
101
 
<!-- ##### SIGNAL GtkExpander::activate ##### -->
102
 
<para>
103
 
 
104
 
</para>
105
 
 
106
 
@expander: the object which received the signal.
107
 
 
108
 
<!-- ##### ARG GtkExpander:expanded ##### -->
109
 
<para>
110
 
 
111
 
</para>
112
 
 
113
 
<!-- ##### ARG GtkExpander:label ##### -->
114
 
<para>
115
 
 
116
 
</para>
117
 
 
118
 
<!-- ##### ARG GtkExpander:label-fill ##### -->
119
 
<para>
120
 
 
121
 
</para>
122
 
 
123
 
<!-- ##### ARG GtkExpander:label-widget ##### -->
124
 
<para>
125
 
 
126
 
</para>
127
 
 
128
 
<!-- ##### ARG GtkExpander:spacing ##### -->
129
 
<para>
130
 
 
131
 
</para>
132
 
 
133
 
<!-- ##### ARG GtkExpander:use-markup ##### -->
134
 
<para>
135
 
 
136
 
</para>
137
 
 
138
 
<!-- ##### ARG GtkExpander:use-underline ##### -->
139
 
<para>
140
 
 
141
 
</para>
142
 
 
143
 
<!-- ##### ARG GtkExpander:expander-size ##### -->
144
 
<para>
145
 
 
146
 
</para>
147
 
 
148
 
<!-- ##### ARG GtkExpander:expander-spacing ##### -->
149
 
<para>
150
 
 
151
 
</para>
152
 
 
153
 
<!-- ##### FUNCTION gtk_expander_new ##### -->
154
 
<para>
155
 
 
156
 
</para>
157
 
 
158
 
@label: 
159
 
@Returns: 
160
 
 
161
 
 
162
 
<!-- ##### FUNCTION gtk_expander_new_with_mnemonic ##### -->
163
 
<para>
164
 
 
165
 
</para>
166
 
 
167
 
@label: 
168
 
@Returns: 
169
 
 
170
 
 
171
 
<!-- ##### FUNCTION gtk_expander_set_expanded ##### -->
172
 
<para>
173
 
 
174
 
</para>
175
 
 
176
 
@expander: 
177
 
@expanded: 
178
 
 
179
 
 
180
 
<!-- ##### FUNCTION gtk_expander_get_expanded ##### -->
181
 
<para>
182
 
 
183
 
</para>
184
 
 
185
 
@expander: 
186
 
@Returns: 
187
 
 
188
 
 
189
 
<!-- ##### FUNCTION gtk_expander_set_spacing ##### -->
190
 
<para>
191
 
 
192
 
</para>
193
 
 
194
 
@expander: 
195
 
@spacing: 
196
 
 
197
 
 
198
 
<!-- ##### FUNCTION gtk_expander_get_spacing ##### -->
199
 
<para>
200
 
 
201
 
</para>
202
 
 
203
 
@expander: 
204
 
@Returns: 
205
 
 
206
 
 
207
 
<!-- ##### FUNCTION gtk_expander_set_label ##### -->
208
 
<para>
209
 
 
210
 
</para>
211
 
 
212
 
@expander: 
213
 
@label: 
214
 
 
215
 
 
216
 
<!-- ##### FUNCTION gtk_expander_get_label ##### -->
217
 
<para>
218
 
 
219
 
</para>
220
 
 
221
 
@expander: 
222
 
@Returns: 
223
 
 
224
 
 
225
 
<!-- ##### FUNCTION gtk_expander_set_use_underline ##### -->
226
 
<para>
227
 
 
228
 
</para>
229
 
 
230
 
@expander: 
231
 
@use_underline: 
232
 
 
233
 
 
234
 
<!-- ##### FUNCTION gtk_expander_get_use_underline ##### -->
235
 
<para>
236
 
 
237
 
</para>
238
 
 
239
 
@expander: 
240
 
@Returns: 
241
 
 
242
 
 
243
 
<!-- ##### FUNCTION gtk_expander_set_use_markup ##### -->
244
 
<para>
245
 
 
246
 
</para>
247
 
 
248
 
@expander: 
249
 
@use_markup: 
250
 
 
251
 
 
252
 
<!-- ##### FUNCTION gtk_expander_get_use_markup ##### -->
253
 
<para>
254
 
 
255
 
</para>
256
 
 
257
 
@expander: 
258
 
@Returns: 
259
 
 
260
 
 
261
 
<!-- ##### FUNCTION gtk_expander_set_label_widget ##### -->
262
 
<para>
263
 
 
264
 
</para>
265
 
 
266
 
@expander: 
267
 
@label_widget: 
268
 
 
269
 
 
270
 
<!-- ##### FUNCTION gtk_expander_get_label_widget ##### -->
271
 
<para>
272
 
 
273
 
</para>
274
 
 
275
 
@expander: 
276
 
@Returns: 
277
 
 
278
 
 
279
 
<!-- ##### FUNCTION gtk_expander_set_label_fill ##### -->
280
 
<para>
281
 
 
282
 
</para>
283
 
 
284
 
@expander: 
285
 
@label_fill: 
286
 
 
287
 
 
288
 
<!-- ##### FUNCTION gtk_expander_get_label_fill ##### -->
289
 
<para>
290
 
 
291
 
</para>
292
 
 
293
 
@expander: 
294
 
@Returns: 
295
 
 
296