1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 A container which can hide its child
7 <!-- ##### SECTION Long_Description ##### -->
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.
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.
20 <section id="expander-special-usage">
21 <title>Special Usage</title>
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:
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);
41 expander_callback (GObject *object,
42 GParamSpec *param_spec,
45 GtkExpander *expander;
47 expander = GTK_EXPANDER (object);
49 if (gtk_expander_get_expanded (expander))
51 /* Show or create widgets */
55 /* Hide or destroy widgets */
60 <refsect2 id="GtkExpander-BUILDER-UI">
61 <title>GtkExpander as GtkBuildable</title>
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 <child> element.
66 A normal content child can be specified without specifying
67 a <child> type attribute.
70 <title>A UI definition fragment with GtkExpander</title>
71 <programlisting><![CDATA[
72 <object class="GtkExpander">
74 <object class="GtkLabel" id="expander-label"/>
77 <object class="GtkEntry" id="expander-content"/>
84 <!-- ##### SECTION See_Also ##### -->
89 <!-- ##### SECTION Stability_Level ##### -->
92 <!-- ##### STRUCT GtkExpander ##### -->
98 <!-- ##### SIGNAL GtkExpander::activate ##### -->
103 @expander: the object which received the signal.
105 <!-- ##### ARG GtkExpander:expanded ##### -->
110 <!-- ##### ARG GtkExpander:label ##### -->
115 <!-- ##### ARG GtkExpander:label-widget ##### -->
120 <!-- ##### ARG GtkExpander:spacing ##### -->
125 <!-- ##### ARG GtkExpander:use-markup ##### -->
130 <!-- ##### ARG GtkExpander:use-underline ##### -->
135 <!-- ##### ARG GtkExpander:expander-size ##### -->
140 <!-- ##### ARG GtkExpander:expander-spacing ##### -->
145 <!-- ##### FUNCTION gtk_expander_new ##### -->
154 <!-- ##### FUNCTION gtk_expander_new_with_mnemonic ##### -->
163 <!-- ##### FUNCTION gtk_expander_set_expanded ##### -->
172 <!-- ##### FUNCTION gtk_expander_get_expanded ##### -->
181 <!-- ##### FUNCTION gtk_expander_set_spacing ##### -->
190 <!-- ##### FUNCTION gtk_expander_get_spacing ##### -->
199 <!-- ##### FUNCTION gtk_expander_set_label ##### -->
208 <!-- ##### FUNCTION gtk_expander_get_label ##### -->
217 <!-- ##### FUNCTION gtk_expander_set_use_underline ##### -->
226 <!-- ##### FUNCTION gtk_expander_get_use_underline ##### -->
235 <!-- ##### FUNCTION gtk_expander_set_use_markup ##### -->
244 <!-- ##### FUNCTION gtk_expander_get_use_markup ##### -->
253 <!-- ##### FUNCTION gtk_expander_set_label_widget ##### -->
262 <!-- ##### FUNCTION gtk_expander_get_label_widget ##### -->