Back to Seed Clases







Class Gtk.Expander

Import line: Gtk =;
GIR File: Gtk-3.0.gir
C documentation: GtkExpander
Class : Expander
Implements: Atk.ImplementorIface, Gtk.Buildable
Extends: Gtk.Bin
A GtkExpander allows the user to hide or show its child by clicking
on an expander triangle similar to the triangles used in a GtkTreeView.
Normally you use an expander as you would use any other descendant
of GtkBin; you create the child widget and use gtk_container_add()
to add it to the expander. When the expander is toggled, it will take
care of showing and hiding the child automatically.

Special Usage

There are situations in which you may prefer to show and hide the
expanded widget yourself, such as when you want to actually create
the widget at expansion time. In this case, create a GtkExpander
but do not add a child to it. The expander widget has an
GtkExpander:expanded property which can be used to monitor
its expansion state. You should watch this property with a signal
connection as follows:

expander = gtk_expander_new_with_mnemonic ("_More Options");
g_signal_connect (expander, "notify::expanded",
G_CALLBACK (expander_callback), NULL);
static void
expander_callback (GObject *object,
GParamSpec *param_spec,
gpointer user_data)
GtkExpander *expander;
expander = GTK_EXPANDER (object);
if (gtk_expander_get_expanded (expander))
/* Show or create widgets */
/* Hide or destroy widgets */

GtkExpander as GtkBuildable

The GtkExpander implementation of the GtkBuildable interface
supports placing a child in the label position by specifying
"label" as the "type" attribute of a <child> element.
A normal content child can be specified without specifying
a <child> type attribute.

A UI definition fragment with GtkExpander


Properties Defined By
Methods / Constructors
Method / Constructor Defined By
Events - usage syntax: this.signals.EVENTNAME.connect( Function )
Event Defined By
Used by These Methods / Signals / Properties- Nowhere other than here
Documentation generated by Introspection Doc Generator Loosely Based on JsDoc Toolkit on Sat Apr 16 2011 17:12:36 GMT+0800 (HKT)